Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/Ultimaker/Cura.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArjen Hiemstra <ahiemstra@heimr.nl>2015-06-25 14:54:36 +0300
committerArjen Hiemstra <ahiemstra@heimr.nl>2015-06-25 14:54:36 +0300
commit886dac57817dc570483863332e66c746fb06bd17 (patch)
tree3b7c893c62086f23a72131afff31a39e29361731 /cura/PlatformPhysics.py
parent8ca0e8eef2595a88136103b469f6529209f0b8d4 (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.py13
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