yade-dev team mailing list archive
-
yade-dev team
-
Mailing list archive
-
Message #04273
[Branch ~yade-dev/yade/trunk] Rev 2198: Ubuntu 10.04LTS has GMSH version, where medit-mesh format is changed.
------------------------------------------------------------
revno: 2198
committer: Anton Gladky <gladky.anton@xxxxxxxxx>
branch nick: trunk
timestamp: Tue 2010-05-04 20:20:28 +0200
message:
Ubuntu 10.04LTS has GMSH version, where medit-mesh format is changed.
It fixes wrong import of newly formatted files.
Back compatibility is saved.
modified:
py/ymport.py
--
lp:yade
https://code.launchpad.net/~yade-dev/yade/trunk
Your team Yade developers is subscribed to branch lp:yade.
To unsubscribe from this branch go to https://code.launchpad.net/~yade-dev/yade/trunk/+edit-subscription
=== modified file 'py/ymport.py'
--- py/ymport.py 2010-05-02 15:59:40 +0000
+++ py/ymport.py 2010-05-04 18:20:28 +0000
@@ -106,13 +106,20 @@
data = line.split()
nodelistVector3[id] = qTemp.Rotate(Vector3(float(data[0])*scale,float(data[1])*scale,float(data[2])*scale))+Vector3(shift[0],shift[1],shift[2])
id += 1
- numTriangles = int(lines[numNodes+findVerticesString+2].split()[0])
+
+
+ findTriangleString=findVerticesString+numNodes
+ while (lines[findTriangleString].split()[0]<>'Triangles'): #Find the string with the number of Triangles
+ findTriangleString+=1
+ findTriangleString+=1
+ numTriangles = int(lines[findTriangleString].split()[0])
+
triList = []
for i in range(numTriangles):
triList.append([0,0,0,0])
tid = 0
- for line in lines[numNodes+findVerticesString+3:numNodes+findVerticesString+3+numTriangles]:
+ for line in lines[findTriangleString+1:findTriangleString+numTriangles+1]:
data = line.split()
id1 = int(data[0])-1
id2 = int(data[1])-1