mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-06-04 11:14:21 +08:00
One at a time mode now adds platform adhesion to convex hulls
CURA-403
This commit is contained in:
parent
7d8b3dfa51
commit
3f5d7b0f53
@ -280,7 +280,7 @@ class BuildVolume(SceneNode):
|
|||||||
self._height = self._global_container_stack.getProperty("machine_height", "value")
|
self._height = self._global_container_stack.getProperty("machine_height", "value")
|
||||||
rebuild_me = True
|
rebuild_me = True
|
||||||
|
|
||||||
if setting_key in self._skirt_settings or setting_key in self._prime_settings or setting_key in self._tower_settings:
|
if setting_key in self._skirt_settings or setting_key in self._prime_settings or setting_key in self._tower_settings or setting_key == "print_sequence":
|
||||||
self._updateDisallowedAreas()
|
self._updateDisallowedAreas()
|
||||||
rebuild_me = True
|
rebuild_me = True
|
||||||
|
|
||||||
@ -383,6 +383,10 @@ class BuildVolume(SceneNode):
|
|||||||
def _getBedAdhesionSize(self, container_stack):
|
def _getBedAdhesionSize(self, container_stack):
|
||||||
skirt_size = 0.0
|
skirt_size = 0.0
|
||||||
|
|
||||||
|
# If we are printing one at a time, we need to add the bed adhesion size to the disallowed areas of the objects
|
||||||
|
if container_stack.getProperty("print_sequence", "value") == "one_at_a_time":
|
||||||
|
return 0.1 # Return a very small value, so we do draw disallowed area's near the edges.
|
||||||
|
|
||||||
adhesion_type = container_stack.getProperty("adhesion_type", "value")
|
adhesion_type = container_stack.getProperty("adhesion_type", "value")
|
||||||
if adhesion_type == "skirt":
|
if adhesion_type == "skirt":
|
||||||
skirt_distance = container_stack.getProperty("skirt_gap", "value")
|
skirt_distance = container_stack.getProperty("skirt_gap", "value")
|
||||||
|
@ -56,6 +56,7 @@ class ConvexHullDecorator(SceneNodeDecorator):
|
|||||||
if self._global_stack and self._node:
|
if self._global_stack and self._node:
|
||||||
if self._global_stack.getProperty("print_sequence", "value") == "one_at_a_time" and not self._node.getParent().callDecoration("isGroup"):
|
if self._global_stack.getProperty("print_sequence", "value") == "one_at_a_time" and not self._node.getParent().callDecoration("isGroup"):
|
||||||
hull = hull.getMinkowskiHull(Polygon(numpy.array(self._global_stack.getProperty("machine_head_polygon", "value"), numpy.float32)))
|
hull = hull.getMinkowskiHull(Polygon(numpy.array(self._global_stack.getProperty("machine_head_polygon", "value"), numpy.float32)))
|
||||||
|
hull = self._add2DAdhesionMargin(hull)
|
||||||
return hull
|
return hull
|
||||||
|
|
||||||
## Get the convex hull of the node with the full head size
|
## Get the convex hull of the node with the full head size
|
||||||
@ -229,17 +230,16 @@ class ConvexHullDecorator(SceneNodeDecorator):
|
|||||||
machine_head_coords = numpy.array(
|
machine_head_coords = numpy.array(
|
||||||
self._global_stack.getProperty("machine_head_with_fans_polygon", "value"),
|
self._global_stack.getProperty("machine_head_with_fans_polygon", "value"),
|
||||||
numpy.float32)
|
numpy.float32)
|
||||||
head_y_size = abs(machine_head_coords).min() # safe margin to take off in all directions
|
|
||||||
|
|
||||||
if adhesion_type == "raft":
|
if adhesion_type == "raft":
|
||||||
extra_margin = max(0, self._global_stack.getProperty("raft_margin", "value") - head_y_size)
|
extra_margin = max(0, self._global_stack.getProperty("raft_margin", "value"))
|
||||||
elif adhesion_type == "brim":
|
elif adhesion_type == "brim":
|
||||||
extra_margin = max(0, self._global_stack.getProperty("brim_width", "value") - head_y_size)
|
extra_margin = max(0, self._global_stack.getProperty("brim_line_count", "value") * self._global_stack.getProperty("skirt_brim_line_width", "value"))
|
||||||
elif adhesion_type == "skirt":
|
elif adhesion_type == "skirt":
|
||||||
extra_margin = max(
|
extra_margin = max(
|
||||||
0, self._global_stack.getProperty("skirt_gap", "value") +
|
0, self._global_stack.getProperty("skirt_gap", "value") +
|
||||||
self._global_stack.getProperty("skirt_line_count", "value") * self._global_stack.getProperty("skirt_brim_line_width", "value") -
|
self._global_stack.getProperty("skirt_line_count", "value") * self._global_stack.getProperty("skirt_brim_line_width", "value"))
|
||||||
head_y_size)
|
|
||||||
# adjust head_and_fans with extra margin
|
# adjust head_and_fans with extra margin
|
||||||
if extra_margin > 0:
|
if extra_margin > 0:
|
||||||
# In Cura 2.2+, there is a function to create this circle-like polygon.
|
# In Cura 2.2+, there is a function to create this circle-like polygon.
|
||||||
@ -288,4 +288,4 @@ class ConvexHullDecorator(SceneNodeDecorator):
|
|||||||
_affected_settings = [
|
_affected_settings = [
|
||||||
"adhesion_type", "raft_base_thickness", "raft_interface_thickness", "raft_surface_layers",
|
"adhesion_type", "raft_base_thickness", "raft_interface_thickness", "raft_surface_layers",
|
||||||
"raft_surface_thickness", "raft_airgap", "raft_margin", "print_sequence",
|
"raft_surface_thickness", "raft_airgap", "raft_margin", "print_sequence",
|
||||||
"skirt_gap", "skirt_line_count", "skirt_brim_line_width", "skirt_distance"]
|
"skirt_gap", "skirt_line_count", "skirt_brim_line_width", "skirt_distance", "brim_line_count"]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user