diff --git a/cura/CuraApplication.py b/cura/CuraApplication.py index 9d068d1214..de4c6e0681 100644 --- a/cura/CuraApplication.py +++ b/cura/CuraApplication.py @@ -546,12 +546,12 @@ class CuraApplication(QtApplication): for _ in range(count): if node.getParent() and node.getParent().callDecoration("isGroup"): new_node = copy.deepcopy(node.getParent()) #Copy the group node. - new_node.callDecoration("setConvexHull",None) + new_node.callDecoration("recomputeConvexHull") op.addOperation(AddSceneNodeOperation(new_node,node.getParent().getParent())) else: new_node = copy.deepcopy(node) - new_node.callDecoration("setConvexHull", None) + new_node.callDecoration("recomputeConvexHull") op.addOperation(AddSceneNodeOperation(new_node, node.getParent())) op.push() diff --git a/cura/PlatformPhysics.py b/cura/PlatformPhysics.py index c43d0d09d7..e4844baf31 100644 --- a/cura/PlatformPhysics.py +++ b/cura/PlatformPhysics.py @@ -7,7 +7,6 @@ from UM.Scene.SceneNode import SceneNode from UM.Scene.Iterator.BreadthFirstIterator import BreadthFirstIterator from UM.Math.Vector import Vector from UM.Math.AxisAlignedBox import AxisAlignedBox -from UM.Application import Application from UM.Scene.Selection import Selection from UM.Preferences import Preferences @@ -16,8 +15,6 @@ from cura.ConvexHullDecorator import ConvexHullDecorator from . import PlatformPhysicsOperation from . import ZOffsetDecorator -import copy - class PlatformPhysics: def __init__(self, controller, volume): super().__init__() @@ -100,18 +97,15 @@ class PlatformPhysics: # continue # Get the overlap distance for both convex hulls. If this returns None, there is no intersection. - try: - head_hull = node.callDecoration("getConvexHullHead") - if head_hull: - overlap = head_hull.intersectsPolygon(other_node.callDecoration("getConvexHull")) - if not overlap: - other_head_hull = other_node.callDecoration("getConvexHullHead") - if other_head_hull: - overlap = node.callDecoration("getConvexHull").intersectsPolygon(other_head_hull) - else: - overlap = node.callDecoration("getConvexHull").intersectsPolygon(other_node.callDecoration("getConvexHull")) - except: - overlap = None #It can sometimes occur that the calculated convex hull has no size, in which case there is no overlap. + head_hull = node.callDecoration("getConvexHullHead") + if head_hull: + overlap = head_hull.intersectsPolygon(other_node.callDecoration("getConvexHull")) + if not overlap: + other_head_hull = other_node.callDecoration("getConvexHullHead") + if other_head_hull: + overlap = node.callDecoration("getConvexHull").intersectsPolygon(other_head_hull) + else: + overlap = node.callDecoration("getConvexHull").intersectsPolygon(other_node.callDecoration("getConvexHull")) if overlap is None: continue diff --git a/cura/ZOffsetDecorator.py b/cura/ZOffsetDecorator.py index 5c3c9e219b..c2912454de 100644 --- a/cura/ZOffsetDecorator.py +++ b/cura/ZOffsetDecorator.py @@ -10,3 +10,6 @@ class ZOffsetDecorator(SceneNodeDecorator): def getZOffset(self): return self._z_offset + + def __deepcopy__(self, memo): + return ZOffsetDecorator()