mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-06 22:47:29 -06:00
Added extra checks & logging to 3mf reader
CURA-382
This commit is contained in:
parent
9a0946687b
commit
dadcf45f45
1 changed files with 6 additions and 1 deletions
|
@ -77,6 +77,7 @@ class ThreeMFReader(MeshReader):
|
|||
mesh_data = mesh_builder.build().getTransformed(rotation)
|
||||
|
||||
if not len(mesh_data.getVertices()):
|
||||
Logger.log("d", "One of the objects does not have vertices. Skipping it.")
|
||||
continue # This object doesn't have data, so skip it.
|
||||
|
||||
node.setMeshData(mesh_data)
|
||||
|
@ -114,6 +115,7 @@ class ThreeMFReader(MeshReader):
|
|||
try:
|
||||
node.getBoundingBox() # Selftest - There might be more functions that should fail
|
||||
except:
|
||||
Logger.log("w", "Bounding box test for object failed. Skipping this object")
|
||||
continue
|
||||
|
||||
result.addChild(node)
|
||||
|
@ -125,7 +127,10 @@ class ThreeMFReader(MeshReader):
|
|||
group_decorator = GroupDecorator()
|
||||
result.addDecorator(group_decorator)
|
||||
elif len(objects) == 1:
|
||||
if result.getChildren():
|
||||
result = result.getChildren()[0] # Only one object found, return that.
|
||||
else: # we failed to load any data
|
||||
return None
|
||||
except Exception as e:
|
||||
Logger.log("e", "exception occured in 3mf reader: %s", e)
|
||||
try: # Selftest - There might be more functions that should fail
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue