mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-11 01:19:01 +08:00
X3D reader no longer creates critical exceptions in the rest of cura
CURA-2083
This commit is contained in:
parent
51dee95c8f
commit
a94d98dfed
@ -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…
x
Reference in New Issue
Block a user