Commit 457ac50f authored by sumpfralle's avatar sumpfralle

STLImporter: handle invalid input lines properly (skip 'em)

return "None" if the model contains no valid elements at all


git-svn-id: https://pycam.svn.sourceforge.net/svnroot/pycam/trunk@868 bbaffbd6-741e-11dd-a85d-61de82d9cad9
parent 83fcd65b
......@@ -227,7 +227,9 @@ def ImportModel(filename, use_kdtree=True, program_locations=None, unit=None,
+ "%d of '%s'. Please validate the STL file!") \
% (current_line, filename))
n, p1, p2, p3 = None, None, None, None
continue
if not n:
print p1, p2, p3
n = p2.sub(p1).cross(p3.sub(p1)).normalized()
# validate the normal
......@@ -273,5 +275,9 @@ def ImportModel(filename, use_kdtree=True, program_locations=None, unit=None,
edges = 0
kdtree = None
return model
if model.minx is None:
# no valid items added to the model
return None
else:
return model
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