Commit 164bf06b authored by sumpfralle's avatar sumpfralle

removed the axis order of STL files produced by Art of Illusion:

 * if there was a bug in the STL exporter of AOI, then it seems to be fixed now


git-svn-id: https://pycam.svn.sourceforge.net/svnroot/pycam/trunk@473 bbaffbd6-741e-11dd-a85d-61de82d9cad9
parent 1c5080e5
...@@ -168,10 +168,7 @@ def ImportModel(filename, use_kdtree=True): ...@@ -168,10 +168,7 @@ def ImportModel(filename, use_kdtree=True):
model.append(t) model.append(t)
else: else:
AOI = False
solid = re.compile("\s*solid\s+(\w+)\s+.*") solid = re.compile("\s*solid\s+(\w+)\s+.*")
solid_AOI = re.compile("\s*solid\s+\"([\w\-]+)\"; Produced by Art of Illusion.*")
endsolid = re.compile("\s*endsolid\s*") endsolid = re.compile("\s*endsolid\s*")
facet = re.compile("\s*facet\s*") facet = re.compile("\s*facet\s*")
normal = re.compile("\s*facet\s+normal\s+(?P<x>[-+]?(\d+(\.\d*)?|\.\d+)([eE][-+]?\d+)?)\s+(?P<y>[-+]?(\d+(\.\d*)?|\.\d+)([eE][-+]?\d+)?)\s+(?P<z>[-+]?(\d+(\.\d*)?|\.\d+)([eE][-+]?\d+)?)\s+") normal = re.compile("\s*facet\s+normal\s+(?P<x>[-+]?(\d+(\.\d*)?|\.\d+)([eE][-+]?\d+)?)\s+(?P<y>[-+]?(\d+(\.\d*)?|\.\d+)([eE][-+]?\d+)?)\s+(?P<z>[-+]?(\d+(\.\d*)?|\.\d+)([eE][-+]?\d+)?)\s+")
...@@ -181,11 +178,6 @@ def ImportModel(filename, use_kdtree=True): ...@@ -181,11 +178,6 @@ def ImportModel(filename, use_kdtree=True):
vertex = re.compile("\s*vertex\s+(?P<x>[-+]?(\d+(\.\d*)?|\.\d+)([eE][-+]?\d+)?)\s+(?P<y>[-+]?(\d+(\.\d*)?|\.\d+)([eE][-+]?\d+)?)\s+(?P<z>[-+]?(\d+(\.\d*)?|\.\d+)([eE][-+]?\d+)?)\s+") vertex = re.compile("\s*vertex\s+(?P<x>[-+]?(\d+(\.\d*)?|\.\d+)([eE][-+]?\d+)?)\s+(?P<y>[-+]?(\d+(\.\d*)?|\.\d+)([eE][-+]?\d+)?)\s+(?P<z>[-+]?(\d+(\.\d*)?|\.\d+)([eE][-+]?\d+)?)\s+")
for line in f: for line in f:
m = solid_AOI.match(line)
if m:
model.name = m.group(1)
AOI = True
continue
m = solid.match(line) m = solid.match(line)
if m: if m:
model.name = m.group(1) model.name = m.group(1)
...@@ -195,10 +187,7 @@ def ImportModel(filename, use_kdtree=True): ...@@ -195,10 +187,7 @@ def ImportModel(filename, use_kdtree=True):
if m: if m:
m = normal.match(line) m = normal.match(line)
if m: if m:
if AOI: n = Point(float(m.group('x')),float(m.group('y')),float(m.group('z')))
n = Point(float(m.group('x')),float(m.group('z')),float(m.group('y')))
else:
n = Point(float(m.group('x')),float(m.group('y')),float(m.group('z')))
else: else:
n = None n = None
continue continue
...@@ -207,10 +196,7 @@ def ImportModel(filename, use_kdtree=True): ...@@ -207,10 +196,7 @@ def ImportModel(filename, use_kdtree=True):
continue continue
m = vertex.match(line) m = vertex.match(line)
if m: if m:
if AOI: p = UniqueVertex(float(m.group('x')),float(m.group('y')),float(m.group('z')))
p = UniqueVertex(float(m.group('x')),float(m.group('z')),float(m.group('y')))
else:
p = UniqueVertex(float(m.group('x')),float(m.group('y')),float(m.group('z')))
if p1 is None: if p1 is None:
p1 = p p1 = p
elif p2 is None: elif p2 is None:
......
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