mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-06 14:37:29 -06:00
X3D reader no longer creates critical exceptions in the rest of cura
CURA-2083
This commit is contained in:
parent
51dee95c8f
commit
a94d98dfed
1 changed files with 12 additions and 7 deletions
|
@ -78,12 +78,17 @@ class X3DReader(MeshReader):
|
|||
builder.setIndices(numpy.concatenate([shape.faces for shape in self.shapes]))
|
||||
builder.calculateNormals()
|
||||
builder.setFileName(file_name)
|
||||
|
||||
scene = SceneNode()
|
||||
scene.setMeshData(builder.build())
|
||||
scene.setSelectable(True)
|
||||
scene.setName(file_name)
|
||||
scene.getBoundingBox()
|
||||
mesh_data = builder.build()
|
||||
|
||||
# Manually try and get the extents of the mesh_data. This should prevent nasty NaN issues from
|
||||
# leaving the reader.
|
||||
mesh_data.getExtents()
|
||||
|
||||
node = SceneNode()
|
||||
node.setMeshData(mesh_data)
|
||||
node.setSelectable(True)
|
||||
node.setName(file_name)
|
||||
|
||||
else:
|
||||
return None
|
||||
|
||||
|
@ -91,7 +96,7 @@ class X3DReader(MeshReader):
|
|||
Logger.logException("e", "Exception in X3D reader")
|
||||
return None
|
||||
|
||||
return scene
|
||||
return node
|
||||
|
||||
# ------------------------- XML tree traversal
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue