mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-11-02 20:52:20 -07:00
CURA-4400 add checking for enabled extruder in setting _outside_buildarea, cleaned up a bit and factored some functions out BuildVolume
This commit is contained in:
parent
11bad271d3
commit
657a52a5e7
5 changed files with 58 additions and 42 deletions
|
|
@ -4,6 +4,7 @@ from copy import deepcopy
|
|||
from typing import List
|
||||
|
||||
from UM.Application import Application
|
||||
from UM.Math.AxisAlignedBox import AxisAlignedBox
|
||||
from UM.Scene.SceneNode import SceneNode
|
||||
|
||||
from cura.Settings.SettingOverrideDecorator import SettingOverrideDecorator
|
||||
|
|
@ -77,6 +78,29 @@ class CuraSceneNode(SceneNode):
|
|||
1.0
|
||||
]
|
||||
|
||||
def collidesWithBbox(self, check_bbox):
|
||||
bbox = self.getBoundingBox()
|
||||
|
||||
# Mark the node as outside the build volume if the bounding box test fails.
|
||||
if check_bbox.intersectsBox(bbox) != AxisAlignedBox.IntersectionResult.FullIntersection:
|
||||
return True
|
||||
|
||||
return False
|
||||
|
||||
def collidesWithArea(self, areas):
|
||||
convex_hull = self.callDecoration("getConvexHull")
|
||||
if convex_hull:
|
||||
if not convex_hull.isValid():
|
||||
return False
|
||||
|
||||
# Check for collisions between disallowed areas and the object
|
||||
for area in areas:
|
||||
overlap = convex_hull.intersectsPolygon(area)
|
||||
if overlap is None:
|
||||
continue
|
||||
return True
|
||||
return False
|
||||
|
||||
## Taken from SceneNode, but replaced SceneNode with CuraSceneNode
|
||||
def __deepcopy__(self, memo):
|
||||
copy = CuraSceneNode()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue