Don't re-scale convex hulls for groups

The convex hulls for groups are already constructed from the convex hull of the convex hulls of all of their children. Since the children's convex hulls are already scaled, we don't want to scale it again for the group.

Contributes to issue CURA-7118.
This commit is contained in:
Ghostkeeper 2020-09-08 17:45:38 +02:00
parent 59bf1c10af
commit d3e5f9ec93
No known key found for this signature in database
GPG Key ID: D2A8871EE34EC59A

View File

@ -381,11 +381,12 @@ class ConvexHullDecorator(SceneNodeDecorator):
:return: New Polygon instance that is offset with everything that
influences the collision area.
"""
# Shrinkage compensation.
if not self._global_stack: # Should never happen.
return convex_hull
scale_factor = self._global_stack.getProperty("material_shrinkage_percentage", "value") / 100.0
result = convex_hull
if scale_factor != 1.0:
if scale_factor != 1.0 and not self.getNode().callDecoration("isGroup"):
center = None
if self._global_stack.getProperty("print_sequence", "value") == "one_at_a_time":
# Find the root node that's placed in the scene; the root of the mesh group.
@ -408,11 +409,13 @@ class ConvexHullDecorator(SceneNodeDecorator):
if center:
result = convex_hull.scale(scale_factor, [center.x, center.z]) # Yes, use Z instead of Y. Mixed conventions there with how the OpenGL coordinates are transmitted.
# Horizontal expansion.
horizontal_expansion = max(
self._getSettingProperty("xy_offset", "value"),
self._getSettingProperty("xy_offset_layer_0", "value")
)
# Mold.
mold_width = 0
if self._getSettingProperty("mold_enabled", "value"):
mold_width = self._getSettingProperty("mold_width", "value")