Commit f6e182b9 authored by Kliment Yanev's avatar Kliment Yanev

Deal with commas in ascii stl files correctly

parent b5c182a1
...@@ -166,6 +166,7 @@ class stl: ...@@ -166,6 +166,7 @@ class stl:
self.insolid=0 self.insolid=0
return 0 return 0
elif l.startswith("facet normal"): elif l.startswith("facet normal"):
l=l.replace(",",".")
self.infacet=11 self.infacet=11
self.facetloc=0 self.facetloc=0
self.facet=[[0,0,0],[[0,0,0],[0,0,0],[0,0,0]]] self.facet=[[0,0,0],[[0,0,0],[0,0,0],[0,0,0]]]
...@@ -177,6 +178,7 @@ class stl: ...@@ -177,6 +178,7 @@ class stl:
self.facetsminz+=[(min(map(lambda x:x[2], facet[1])),facet)] self.facetsminz+=[(min(map(lambda x:x[2], facet[1])),facet)]
self.facetsmaxz+=[(max(map(lambda x:x[2], facet[1])),facet)] self.facetsmaxz+=[(max(map(lambda x:x[2], facet[1])),facet)]
elif l.startswith("vertex"): elif l.startswith("vertex"):
l=l.replace(",",".")
self.facet[1][self.facetloc]=map(float,l.split()[1:]) self.facet[1][self.facetloc]=map(float,l.split()[1:])
self.facetloc+=1 self.facetloc+=1
return 1 return 1
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment