[cig-commits] [commit] baagaard/fix-meshing-examples-trelis, maint, next: Updated spline creation for compatibility with Trelis. (d58a6b5)

cig_noreply at geodynamics.org cig_noreply at geodynamics.org
Wed Jun 25 17:19:33 PDT 2014


Repository : https://github.com/geodynamics/pylith

On branches: baagaard/fix-meshing-examples-trelis,maint,next
Link       : https://github.com/geodynamics/pylith/compare/9e9b3eb32aeee3851bb285945375cc28a2c0fdcf...ffaa715d19b1a8a79173ca5af7d64b65529244c8

>---------------------------------------------------------------

commit d58a6b5e14ef107f5888dc19fe109023c443c898
Author: Brad Aagaard <baagaard at usgs.gov>
Date:   Tue Jun 24 14:55:51 2014 -0700

    Updated spline creation for compatibility with Trelis.


>---------------------------------------------------------------

d58a6b5e14ef107f5888dc19fe109023c443c898
 examples/meshing/surface_nurbs/dem/dem2lines.py | 19 ++++++++++++++-----
 1 file changed, 14 insertions(+), 5 deletions(-)

diff --git a/examples/meshing/surface_nurbs/dem/dem2lines.py b/examples/meshing/surface_nurbs/dem/dem2lines.py
index 60171aa..13f62c8 100644
--- a/examples/meshing/surface_nurbs/dem/dem2lines.py
+++ b/examples/meshing/surface_nurbs/dem/dem2lines.py
@@ -367,9 +367,14 @@ class Dem2Lines(Application):
       masterString = masterPref + outputFileName + "'" + newLine
       um.write(masterString)
       u = open(outputFileName, 'w')
-      u.write('create curve spline')
       for column in range(self.numXOut):
-        u.write(fmt % (self.xOut[column], y, self.zOut[row, column]))
+        point = (self.xOut[column], y, self.zOut[row, column])
+        u.write("create vertex x %10.5e y %10.5e z %10.5e\n" % \
+                    (point[0], point[1], point[2]))
+        if 0 == column:
+            u.write("${idBeg=Id('vertex')}\n")
+      u.write("${idEnd=Id('vertex')}\n")
+      u.write("create curve spline vertex {idBeg} to {idEnd} delete\n")
 
       u.close()
 
@@ -385,10 +390,14 @@ class Dem2Lines(Application):
       masterString = masterPref + outputFileName + "'" + newLine
       vm.write(masterString)
       v = open(outputFileName, 'w')
-      v.write('create curve spline')
       for row in range(self.numYOut):
-        v.write(fmt % (x, self.yOut[row], self.zOut[row, column]))
-
+        point = (x, self.yOut[row], self.zOut[row, column])
+        v.write("create vertex x %10.5e y %10.5e z %10.5e\n" % \
+                    (point[0], point[1], point[2]))
+        if 0 == row:
+            v.write("${idBeg=Id('vertex')}\n")
+      v.write("${idEnd=Id('vertex')}\n")
+      v.write("create curve spline vertex {idBeg} to {idEnd} delete\n")
       v.close()
 
     vm.close()



More information about the CIG-COMMITS mailing list