mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-25 07:33:57 -06:00
Don't include group nodes in AABB
In fact, don't include any node that would just have a position rather than actual data. The rest of the code is robust anyway against there being no AABB. Contributes to issue CURA-6416.
This commit is contained in:
parent
f3d75fa1ef
commit
ff99c4e45f
1 changed files with 8 additions and 8 deletions
|
@ -112,21 +112,21 @@ class CuraSceneNode(SceneNode):
|
||||||
|
|
||||||
## Override of SceneNode._calculateAABB to exclude non-printing-meshes from bounding box
|
## Override of SceneNode._calculateAABB to exclude non-printing-meshes from bounding box
|
||||||
def _calculateAABB(self) -> None:
|
def _calculateAABB(self) -> None:
|
||||||
|
self._aabb = None
|
||||||
if self._mesh_data:
|
if self._mesh_data:
|
||||||
aabb = self._mesh_data.getExtents(self.getWorldTransformation())
|
self._aabb = self._mesh_data.getExtents(self.getWorldTransformation())
|
||||||
else: # If there is no mesh_data, use a boundingbox that encompasses the local (0,0,0)
|
|
||||||
position = self.getWorldPosition()
|
|
||||||
aabb = AxisAlignedBox(minimum = position, maximum = position)
|
|
||||||
|
|
||||||
for child in self._children:
|
for child in self._children:
|
||||||
if child.callDecoration("isNonPrintingMesh"):
|
if child.callDecoration("isNonPrintingMesh"):
|
||||||
# Non-printing-meshes inside a group should not affect push apart or drop to build plate
|
# Non-printing-meshes inside a group should not affect push apart or drop to build plate
|
||||||
continue
|
continue
|
||||||
if aabb is None:
|
if not child._mesh_data:
|
||||||
aabb = child.getBoundingBox()
|
# Nodes without mesh data should not affect bounding boxes of their parents.
|
||||||
|
continue
|
||||||
|
if self._aabb is None:
|
||||||
|
self._aabb = child.getBoundingBox()
|
||||||
else:
|
else:
|
||||||
aabb = aabb + child.getBoundingBox()
|
self._aabb = self._aabb + child.getBoundingBox()
|
||||||
self._aabb = aabb
|
|
||||||
|
|
||||||
## Taken from SceneNode, but replaced SceneNode with CuraSceneNode
|
## Taken from SceneNode, but replaced SceneNode with CuraSceneNode
|
||||||
def __deepcopy__(self, memo: Dict[int, object]) -> "CuraSceneNode":
|
def __deepcopy__(self, memo: Dict[int, object]) -> "CuraSceneNode":
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue