mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-12 23:19:01 +08:00
Merge branch '2.3' of https://github.com/Ultimaker/Cura into 2.3
This commit is contained in:
commit
37862dde42
@ -15,6 +15,9 @@ from cura.ConvexHullDecorator import ConvexHullDecorator
|
|||||||
from . import PlatformPhysicsOperation
|
from . import PlatformPhysicsOperation
|
||||||
from . import ZOffsetDecorator
|
from . import ZOffsetDecorator
|
||||||
|
|
||||||
|
import random # used for list shuffling
|
||||||
|
|
||||||
|
|
||||||
class PlatformPhysics:
|
class PlatformPhysics:
|
||||||
def __init__(self, controller, volume):
|
def __init__(self, controller, volume):
|
||||||
super().__init__()
|
super().__init__()
|
||||||
@ -49,8 +52,11 @@ class PlatformPhysics:
|
|||||||
transformed_nodes = []
|
transformed_nodes = []
|
||||||
|
|
||||||
group_nodes = []
|
group_nodes = []
|
||||||
|
# We try to shuffle all the nodes to prevent "locked" situations, where iteration B inverts iteration A.
|
||||||
for node in BreadthFirstIterator(root):
|
# By shuffling the order of the nodes, this might happen a few times, but at some point it will resolve.
|
||||||
|
nodes = list(BreadthFirstIterator(root))
|
||||||
|
random.shuffle(nodes)
|
||||||
|
for node in nodes:
|
||||||
if node is root or type(node) is not SceneNode or node.getBoundingBox() is None:
|
if node is root or type(node) is not SceneNode or node.getBoundingBox() is None:
|
||||||
continue
|
continue
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user