diff options
author | Arjen Hiemstra <ahiemstra@heimr.nl> | 2015-06-25 14:54:36 +0300 |
---|---|---|
committer | Arjen Hiemstra <ahiemstra@heimr.nl> | 2015-06-25 14:54:36 +0300 |
commit | 886dac57817dc570483863332e66c746fb06bd17 (patch) | |
tree | 3b7c893c62086f23a72131afff31a39e29361731 /cura/PlatformPhysics.py | |
parent | 8ca0e8eef2595a88136103b469f6529209f0b8d4 (diff) |
Store the disallowed areas as polygons and use those to test for intersection
This prevents issues when trying to print larger things
Contributes to Asana issue 37107676459484
Diffstat (limited to 'cura/PlatformPhysics.py')
-rw-r--r-- | cura/PlatformPhysics.py | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/cura/PlatformPhysics.py b/cura/PlatformPhysics.py index 444fe2d3cc..9dcd15ad54 100644 --- a/cura/PlatformPhysics.py +++ b/cura/PlatformPhysics.py @@ -94,14 +94,19 @@ class PlatformPhysics: move_vector.setX(overlap[0] * 1.1) move_vector.setZ(overlap[1] * 1.1) + if hasattr(node, "_convex_hull"): + # Check for collisions between disallowed areas and the object + for area in self._build_volume.getDisallowedAreas(): + overlap = node._convex_hull.intersectsPolygon(area) + if overlap is None: + continue + + node._outside_buildarea = True + if move_vector != Vector(): op = PlatformPhysicsOperation.PlatformPhysicsOperation(node, move_vector) op.push() - if node.getBoundingBox().intersectsBox(self._build_volume.getBoundingBox()) == AxisAlignedBox.IntersectionResult.FullIntersection: - op = ScaleToBoundsOperation(node, self._build_volume.getBoundingBox()) - op.push() - def _onToolOperationStarted(self, tool): self._enabled = False |