Only push aways other objects if they are printing meshes

CURA-4705
This commit is contained in:
Lipu Fei 2017-12-21 15:51:24 +01:00
parent df1d3bf569
commit 4e90204620

View file

@ -76,7 +76,8 @@ class PlatformPhysics:
if not node.getDecorator(ConvexHullDecorator):
node.addDecorator(ConvexHullDecorator())
if Preferences.getInstance().getValue("physics/automatic_push_free"):
# only push away objects if this node is a printing mesh
if not node.callDecoration("isNonPrintingMesh") and Preferences.getInstance().getValue("physics/automatic_push_free"):
# Check for collisions between convex hulls
for other_node in BreadthFirstIterator(root):
# Ignore root, ourselves and anything that is not a normal SceneNode.
@ -98,6 +99,9 @@ class PlatformPhysics:
if other_node in transformed_nodes:
continue # Other node is already moving, wait for next pass.
if other_node.callDecoration("isNonPrintingMesh"):
continue
overlap = (0, 0) # Start loop with no overlap
current_overlap_checks = 0
# Continue to check the overlap until we no longer find one.