mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-04-29 15:25:02 +08:00
Merge branch 'fix_disallowed_skirt'
This commit is contained in:
commit
7b4097bea4
@ -1,6 +1,6 @@
|
|||||||
# Copyright (c) 2018 Ultimaker B.V.
|
# Copyright (c) 2019 Ultimaker B.V.
|
||||||
# Cura is released under the terms of the LGPLv3 or higher.
|
# Cura is released under the terms of the LGPLv3 or higher.
|
||||||
from UM.Scene.Camera import Camera
|
|
||||||
from cura.Scene.CuraSceneNode import CuraSceneNode
|
from cura.Scene.CuraSceneNode import CuraSceneNode
|
||||||
from cura.Settings.ExtruderManager import ExtruderManager
|
from cura.Settings.ExtruderManager import ExtruderManager
|
||||||
from UM.Application import Application #To modify the maximum zoom level.
|
from UM.Application import Application #To modify the maximum zoom level.
|
||||||
@ -736,7 +736,7 @@ class BuildVolume(SceneNode):
|
|||||||
# Add prime tower location as disallowed area.
|
# Add prime tower location as disallowed area.
|
||||||
if len(used_extruders) > 1: #No prime tower in single-extrusion.
|
if len(used_extruders) > 1: #No prime tower in single-extrusion.
|
||||||
|
|
||||||
if len([x for x in used_extruders if x.isEnabled == True]) > 1: #No prime tower if only one extruder is enabled
|
if len([x for x in used_extruders if x.isEnabled]) > 1: #No prime tower if only one extruder is enabled
|
||||||
prime_tower_collision = False
|
prime_tower_collision = False
|
||||||
prime_tower_areas = self._computeDisallowedAreasPrinted(used_extruders)
|
prime_tower_areas = self._computeDisallowedAreasPrinted(used_extruders)
|
||||||
for extruder_id in prime_tower_areas:
|
for extruder_id in prime_tower_areas:
|
||||||
@ -1027,7 +1027,18 @@ class BuildVolume(SceneNode):
|
|||||||
adhesion_type = container_stack.getProperty("adhesion_type", "value")
|
adhesion_type = container_stack.getProperty("adhesion_type", "value")
|
||||||
skirt_brim_line_width = self._global_container_stack.getProperty("skirt_brim_line_width", "value")
|
skirt_brim_line_width = self._global_container_stack.getProperty("skirt_brim_line_width", "value")
|
||||||
initial_layer_line_width_factor = self._global_container_stack.getProperty("initial_layer_line_width_factor", "value")
|
initial_layer_line_width_factor = self._global_container_stack.getProperty("initial_layer_line_width_factor", "value")
|
||||||
if adhesion_type == "skirt":
|
#Use brim width if brim is enabled OR the prime tower has a brim.
|
||||||
|
if adhesion_type == "brim" or (self._global_container_stack.getProperty("prime_tower_brim_enable", "value") and
|
||||||
|
adhesion_type != "raft"):
|
||||||
|
brim_line_count = self._global_container_stack.getProperty("brim_line_count", "value")
|
||||||
|
bed_adhesion_size = skirt_brim_line_width * brim_line_count * initial_layer_line_width_factor / 100.0
|
||||||
|
|
||||||
|
for extruder_stack in used_extruders:
|
||||||
|
bed_adhesion_size += extruder_stack.getProperty("skirt_brim_line_width", "value") * extruder_stack.getProperty("initial_layer_line_width_factor", "value") / 100.0
|
||||||
|
|
||||||
|
# We don't create an additional line for the extruder we're printing the brim with.
|
||||||
|
bed_adhesion_size -= skirt_brim_line_width * initial_layer_line_width_factor / 100.0
|
||||||
|
elif adhesion_type == "skirt": #No brim? Also not on prime tower? Then use whatever the adhesion type is saying: Skirt, raft or none.
|
||||||
skirt_distance = self._global_container_stack.getProperty("skirt_gap", "value")
|
skirt_distance = self._global_container_stack.getProperty("skirt_gap", "value")
|
||||||
skirt_line_count = self._global_container_stack.getProperty("skirt_line_count", "value")
|
skirt_line_count = self._global_container_stack.getProperty("skirt_line_count", "value")
|
||||||
|
|
||||||
@ -1038,19 +1049,6 @@ class BuildVolume(SceneNode):
|
|||||||
|
|
||||||
# We don't create an additional line for the extruder we're printing the skirt with.
|
# We don't create an additional line for the extruder we're printing the skirt with.
|
||||||
bed_adhesion_size -= skirt_brim_line_width * initial_layer_line_width_factor / 100.0
|
bed_adhesion_size -= skirt_brim_line_width * initial_layer_line_width_factor / 100.0
|
||||||
|
|
||||||
elif (adhesion_type == "brim" or
|
|
||||||
(self._global_container_stack.getProperty("prime_tower_brim_enable", "value") and
|
|
||||||
self._global_container_stack.getProperty("adhesion_type", "value") != "raft")):
|
|
||||||
brim_line_count = self._global_container_stack.getProperty("brim_line_count", "value")
|
|
||||||
bed_adhesion_size = skirt_brim_line_width * brim_line_count * initial_layer_line_width_factor / 100.0
|
|
||||||
|
|
||||||
for extruder_stack in used_extruders:
|
|
||||||
bed_adhesion_size += extruder_stack.getProperty("skirt_brim_line_width", "value") * extruder_stack.getProperty("initial_layer_line_width_factor", "value") / 100.0
|
|
||||||
|
|
||||||
# We don't create an additional line for the extruder we're printing the brim with.
|
|
||||||
bed_adhesion_size -= skirt_brim_line_width * initial_layer_line_width_factor / 100.0
|
|
||||||
|
|
||||||
elif adhesion_type == "raft":
|
elif adhesion_type == "raft":
|
||||||
bed_adhesion_size = self._global_container_stack.getProperty("raft_margin", "value")
|
bed_adhesion_size = self._global_container_stack.getProperty("raft_margin", "value")
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user