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:
authorJaime van Kessel <nallath@gmail.com>2016-09-06 12:42:46 +0300
committerJaime van Kessel <nallath@gmail.com>2016-09-06 12:42:46 +0300
commit75c1f12d33a6ac817677338d9d1eaf1e2fcd714f (patch)
tree6c41fb5aac5579bd2fcf6db99e9531d6e665571f /cura/PlatformPhysics.py
parent6db03538a17de768165397f39646fe6afbc8a1c8 (diff)
If a group node is outside build area, all it's children are also marked as such
CURA-403
Diffstat (limited to 'cura/PlatformPhysics.py')
-rw-r--r--cura/PlatformPhysics.py12
1 files changed, 11 insertions, 1 deletions
diff --git a/cura/PlatformPhysics.py b/cura/PlatformPhysics.py
index d718f25b87..d25a74bf91 100644
--- a/cura/PlatformPhysics.py
+++ b/cura/PlatformPhysics.py
@@ -48,6 +48,8 @@ class PlatformPhysics:
# same direction.
transformed_nodes = []
+ group_nodes = []
+
for node in BreadthFirstIterator(root):
if node is root or type(node) is not SceneNode or node.getBoundingBox() is None:
continue
@@ -69,6 +71,9 @@ class PlatformPhysics:
if build_volume_bounding_box.intersectsBox(bbox) != AxisAlignedBox.IntersectionResult.FullIntersection:
node._outside_buildarea = True
+ if node.callDecoration("isGroup"):
+ group_nodes.append(node) # Keep list of affected group_nodes
+
# Move it downwards if bottom is above platform
move_vector = Vector()
if Preferences.getInstance().getValue("physics/automatic_drop_down") and not (node.getParent() and node.getParent().callDecoration("isGroup")): #If an object is grouped, don't move it down
@@ -144,7 +149,6 @@ class PlatformPhysics:
overlap = convex_hull.intersectsPolygon(area)
if overlap is None:
continue
-
node._outside_buildarea = True
if not Vector.Null.equals(move_vector, epsilon=1e-5):
@@ -152,6 +156,12 @@ class PlatformPhysics:
op = PlatformPhysicsOperation.PlatformPhysicsOperation(node, move_vector)
op.push()
+ # Group nodes should override the _outside_buildarea property of their children.
+ for group_node in group_nodes:
+ for child_node in group_node.getAllChildren():
+ child_node._outside_buildarea = group_node._outside_buildarea
+
+
def _onToolOperationStarted(self, tool):
self._enabled = False