mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-11-02 20:52:20 -07:00
Merge pull request #2758 from fieldOfView/feature_mesh_types
Improved mesh type UX (Per Model Settings)
This commit is contained in:
commit
0668f80792
9 changed files with 168 additions and 42 deletions
|
|
@ -52,6 +52,8 @@ class Arrange:
|
|||
# Place all objects fixed nodes
|
||||
for fixed_node in fixed_nodes:
|
||||
vertices = fixed_node.callDecoration("getConvexHull")
|
||||
if not vertices:
|
||||
continue
|
||||
points = copy.deepcopy(vertices._points)
|
||||
shape_arr = ShapeArray.fromPolygon(points, scale = scale)
|
||||
arranger.place(0, 0, shape_arr)
|
||||
|
|
|
|||
|
|
@ -56,6 +56,11 @@ class ConvexHullDecorator(SceneNodeDecorator):
|
|||
if self._node is None:
|
||||
return None
|
||||
|
||||
if getattr(self._node, "_non_printing_mesh", False):
|
||||
# infill_mesh, cutting_mesh and anti_overhang_mesh do not need a convex hull
|
||||
# node._non_printing_mesh is set in SettingOverrideDecorator
|
||||
return None
|
||||
|
||||
hull = self._compute2DConvexHull()
|
||||
|
||||
if self._global_stack and self._node:
|
||||
|
|
|
|||
|
|
@ -22,6 +22,14 @@ class SettingOverrideDecorator(SceneNodeDecorator):
|
|||
## Event indicating that the user selected a different extruder.
|
||||
activeExtruderChanged = Signal()
|
||||
|
||||
## Non-printing meshes
|
||||
#
|
||||
# If these settings are True for any mesh, the mesh does not need a convex hull,
|
||||
# and is sent to the slicer regardless of whether it fits inside the build volume.
|
||||
# Note that Support Mesh is not in here because it actually generates
|
||||
# g-code in the volume of the mesh.
|
||||
_non_printing_mesh_settings = {"anti_overhang_mesh", "infill_mesh", "cutting_mesh"}
|
||||
|
||||
def __init__(self):
|
||||
super().__init__()
|
||||
self._stack = PerObjectContainerStack(stack_id = id(self))
|
||||
|
|
@ -78,6 +86,8 @@ class SettingOverrideDecorator(SceneNodeDecorator):
|
|||
Application.getInstance().getBackend().needsSlicing()
|
||||
Application.getInstance().getBackend().tickle()
|
||||
|
||||
self._node._non_printing_mesh = any(self._stack.getProperty(setting, "value") for setting in self._non_printing_mesh_settings)
|
||||
|
||||
## Makes sure that the stack upon which the container stack is placed is
|
||||
# kept up to date.
|
||||
def _updateNextStack(self):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue