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.setIndices(numpy.concatenate([shape.faces for shape in self.shapes]))
|
||||||
builder.calculateNormals()
|
builder.calculateNormals()
|
||||||
builder.setFileName(file_name)
|
builder.setFileName(file_name)
|
||||||
|
mesh_data = builder.build()
|
||||||
scene = SceneNode()
|
|
||||||
scene.setMeshData(builder.build())
|
# Manually try and get the extents of the mesh_data. This should prevent nasty NaN issues from
|
||||||
scene.setSelectable(True)
|
# leaving the reader.
|
||||||
scene.setName(file_name)
|
mesh_data.getExtents()
|
||||||
scene.getBoundingBox()
|
|
||||||
|
node = SceneNode()
|
||||||
|
node.setMeshData(mesh_data)
|
||||||
|
node.setSelectable(True)
|
||||||
|
node.setName(file_name)
|
||||||
|
|
||||||
else:
|
else:
|
||||||
return None
|
return None
|
||||||
|
|
||||||
|
@ -91,7 +96,7 @@ class X3DReader(MeshReader):
|
||||||
Logger.logException("e", "Exception in X3D reader")
|
Logger.logException("e", "Exception in X3D reader")
|
||||||
return None
|
return None
|
||||||
|
|
||||||
return scene
|
return node
|
||||||
|
|
||||||
# ------------------------- XML tree traversal
|
# ------------------------- XML tree traversal
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue