diff options
author | Simon Edwards <s.edwards@ultimaker.com> | 2016-06-30 10:32:46 +0300 |
---|---|---|
committer | Simon Edwards <s.edwards@ultimaker.com> | 2016-06-30 10:35:41 +0300 |
commit | 551dc7d757b7256f4843666a134a9e0a1f8217de (patch) | |
tree | 798656733d1ab4ec497002534b4cd9dfc70998ef /cura/PlatformPhysics.py | |
parent | 48852381037af33ec8e6dd9860b626fa9ef72f03 (diff) |
Fixes for the problem where duplicated objects were broken, missing hull 'shadows' or would fly off the build plate.
Contributes to CURA-1504 Improve performance/simplicity by using Convex Hulls in Scene Graph
Diffstat (limited to 'cura/PlatformPhysics.py')
-rw-r--r-- | cura/PlatformPhysics.py | 24 |
1 files changed, 9 insertions, 15 deletions
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 |