mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-11 10:09:03 +08:00
Revert "Simplify code flow a bit"
This reverts commit 2c45efb70de003b431707aadfc2a3cb37e4dc39c.
This commit is contained in:
parent
2c45efb70d
commit
63f7902fca
@ -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…
x
Reference in New Issue
Block a user