mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-25 07:33:57 -06:00
parent
2c45efb70d
commit
63f7902fca
1 changed files with 34 additions and 33 deletions
|
@ -160,10 +160,10 @@ class ConvexHullDecorator(SceneNodeDecorator):
|
|||
return offset_hull
|
||||
|
||||
else:
|
||||
if not self._node.getMeshData(): #Node has no mesh data, so just return an empty Polygon.
|
||||
return Polygon([])
|
||||
|
||||
offset_hull = None
|
||||
mesh = None
|
||||
world_transform = None
|
||||
if self._node.getMeshData():
|
||||
mesh = self._node.getMeshData()
|
||||
world_transform = self._node.getWorldTransformation()
|
||||
|
||||
|
@ -177,8 +177,7 @@ class ConvexHullDecorator(SceneNodeDecorator):
|
|||
# Do not throw away vertices: the convex hull may be too small and objects can collide.
|
||||
# vertex_data = vertex_data[vertex_data[:,1] >= -0.01]
|
||||
|
||||
if not vertex_data or len(vertex_data) < 4:
|
||||
return Polygon([])
|
||||
if vertex_data and len(vertex_data) >= 4:
|
||||
# Round the vertex data to 1/10th of a mm, then remove all duplicate vertices
|
||||
# This is done to greatly speed up further convex hull calculations as the convex hull
|
||||
# becomes much less complex when dealing with highly detailed models.
|
||||
|
@ -201,6 +200,8 @@ class ConvexHullDecorator(SceneNodeDecorator):
|
|||
if len(vertex_data) >= 3:
|
||||
convex_hull = hull.getConvexHull()
|
||||
offset_hull = self._offsetHull(convex_hull)
|
||||
else:
|
||||
return Polygon([]) # Node has no mesh data, so just return an empty Polygon.
|
||||
|
||||
# Store the result in the cache
|
||||
self._2d_convex_hull_mesh = mesh
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue