mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-14 14:45:55 +08:00
Merge branch 'master' of github.com:Ultimaker/Cura
This commit is contained in:
commit
f9e5f58240
@ -238,7 +238,16 @@ class BuildVolume(SceneNode):
|
||||
|
||||
# Group nodes should override the _outside_buildarea property of their children.
|
||||
for group_node in group_nodes:
|
||||
for child_node in group_node.getAllChildren():
|
||||
children = group_node.getAllChildren()
|
||||
|
||||
# Check if one or more children are non-printable and if so, set the parent as non-printable:
|
||||
for child_node in children:
|
||||
if child_node.isOutsideBuildArea():
|
||||
group_node.setOutsideBuildArea(True)
|
||||
break
|
||||
|
||||
# Apply results of the check to all children of the group:
|
||||
for child_node in children:
|
||||
child_node.setOutsideBuildArea(group_node.isOutsideBuildArea())
|
||||
|
||||
## Update the outsideBuildArea of a single node, given bounds or current build volume
|
||||
|
@ -358,8 +358,10 @@ class ThreeMFWorkspaceReader(WorkspaceReader):
|
||||
machine_name = self._getMachineNameFromSerializedStack(serialized)
|
||||
stacks = self._container_registry.findContainerStacks(name = machine_name, type = "machine")
|
||||
self._is_same_machine_type = True
|
||||
existing_global_stack = None
|
||||
if stacks:
|
||||
global_stack = stacks[0]
|
||||
existing_global_stack = global_stack
|
||||
containers_found_dict["machine"] = True
|
||||
# Check if there are any changes at all in any of the container stacks.
|
||||
id_list = self._getContainerIdListFromSerialized(serialized)
|
||||
@ -495,8 +497,16 @@ class ThreeMFWorkspaceReader(WorkspaceReader):
|
||||
if machine_conflict and not self._is_same_machine_type:
|
||||
machine_conflict = False
|
||||
|
||||
is_printer_group = False
|
||||
if machine_conflict:
|
||||
group_name = existing_global_stack.getMetaDataEntry("connect_group_name")
|
||||
if group_name is not None:
|
||||
is_printer_group = True
|
||||
machine_name = group_name
|
||||
|
||||
# Show the dialog, informing the user what is about to happen.
|
||||
self._dialog.setMachineConflict(machine_conflict)
|
||||
self._dialog.setIsPrinterGroup(is_printer_group)
|
||||
self._dialog.setQualityChangesConflict(quality_changes_conflict)
|
||||
self._dialog.setMaterialConflict(material_conflict)
|
||||
self._dialog.setHasVisibleSettingsField(has_visible_settings_string)
|
||||
|
@ -49,6 +49,7 @@ class WorkspaceDialog(QObject):
|
||||
self._material_labels = []
|
||||
self._extruders = []
|
||||
self._objects_on_plate = False
|
||||
self._is_printer_group = False
|
||||
|
||||
machineConflictChanged = pyqtSignal()
|
||||
qualityChangesConflictChanged = pyqtSignal()
|
||||
@ -66,6 +67,16 @@ class WorkspaceDialog(QObject):
|
||||
machineTypeChanged = pyqtSignal()
|
||||
variantTypeChanged = pyqtSignal()
|
||||
extrudersChanged = pyqtSignal()
|
||||
isPrinterGroupChanged = pyqtSignal()
|
||||
|
||||
@pyqtProperty(bool, notify = isPrinterGroupChanged)
|
||||
def isPrinterGroup(self) -> bool:
|
||||
return self._is_printer_group
|
||||
|
||||
def setIsPrinterGroup(self, value: bool):
|
||||
if value != self._is_printer_group:
|
||||
self._is_printer_group = value
|
||||
self.isPrinterGroupChanged.emit()
|
||||
|
||||
@pyqtProperty(str, notify=variantTypeChanged)
|
||||
def variantType(self):
|
||||
|
@ -108,7 +108,22 @@ UM.Dialog
|
||||
text: catalog.i18nc("@info:tooltip", "How should the conflict in the machine be resolved?")
|
||||
ComboBox
|
||||
{
|
||||
model: resolveStrategiesModel
|
||||
model: ListModel
|
||||
{
|
||||
Component.onCompleted:
|
||||
{
|
||||
append({"key": "override", "label": catalog.i18nc("@action:ComboBox option", "Update") + " " + manager.machineName});
|
||||
append({"key": "new", "label": catalog.i18nc("@action:ComboBox option", "Create new")});
|
||||
}
|
||||
}
|
||||
Connections
|
||||
{
|
||||
target: manager
|
||||
onMachineNameChanged:
|
||||
{
|
||||
machineResolveComboBox.model.get(0).label = catalog.i18nc("@action:ComboBox option", "Update") + " " + manager.machineName;
|
||||
}
|
||||
}
|
||||
textRole: "label"
|
||||
id: machineResolveComboBox
|
||||
width: parent.width
|
||||
@ -141,7 +156,7 @@ UM.Dialog
|
||||
height: childrenRect.height
|
||||
Label
|
||||
{
|
||||
text: catalog.i18nc("@action:label", "Name")
|
||||
text: catalog.i18nc("@action:label", manager.isPrinterGroup ? "Printer Group" : "Printer Name")
|
||||
width: (parent.width / 3) | 0
|
||||
}
|
||||
Label
|
||||
|
@ -197,10 +197,6 @@ class StartSliceJob(Job):
|
||||
if getattr(node, "_outside_buildarea", False) and not is_non_printing_mesh:
|
||||
continue
|
||||
|
||||
#node_position = node.callDecoration("getActiveExtruderPosition")
|
||||
#if not stack.extruders[str(node_position)].isEnabled:
|
||||
# continue
|
||||
|
||||
temp_list.append(node)
|
||||
if not is_non_printing_mesh:
|
||||
has_printing_mesh = True
|
||||
@ -243,7 +239,7 @@ class StartSliceJob(Job):
|
||||
|
||||
for group in filtered_object_groups:
|
||||
group_message = self._slice_message.addRepeatedMessage("object_lists")
|
||||
if group[0].getParent().callDecoration("isGroup"):
|
||||
if group[0].getParent() is not None and group[0].getParent().callDecoration("isGroup"):
|
||||
self._handlePerObjectSettings(group[0].getParent(), group_message)
|
||||
for object in group:
|
||||
mesh_data = object.getMeshData()
|
||||
|
@ -12,6 +12,7 @@ import numpy as np
|
||||
from UM.Logger import Logger
|
||||
from UM.Application import Application
|
||||
import re
|
||||
from cura.Settings.ExtruderManager import ExtruderManager
|
||||
|
||||
def _getValue(line, key, default=None):
|
||||
"""
|
||||
@ -90,9 +91,9 @@ class Stretcher():
|
||||
"""
|
||||
Computes the new X and Y coordinates of all g-code steps
|
||||
"""
|
||||
Logger.log("d", "Post stretch with line width = " + str(self.line_width)
|
||||
+ "mm wide circle stretch = " + str(self.wc_stretch)+ "mm"
|
||||
+ "and push wall stretch = " + str(self.pw_stretch) + "mm")
|
||||
Logger.log("d", "Post stretch with line width " + str(self.line_width)
|
||||
+ "mm wide circle stretch " + str(self.wc_stretch)+ "mm"
|
||||
+ " and push wall stretch " + str(self.pw_stretch) + "mm")
|
||||
retdata = []
|
||||
layer_steps = []
|
||||
current = GCodeStep(0)
|
||||
@ -282,7 +283,7 @@ class Stretcher():
|
||||
dmin_tri is the minimum distance between two consecutive points
|
||||
of an acceptable triangle
|
||||
"""
|
||||
dmin_tri = self.line_width / 2.0
|
||||
dmin_tri = 0.5
|
||||
iextra_base = np.floor_divide(len(orig_seq), 3) # Nb of extra points
|
||||
ibeg = 0 # Index of first point of the triangle
|
||||
iend = 0 # Index of the third point of the triangle
|
||||
@ -325,9 +326,10 @@ class Stretcher():
|
||||
relpos = 0.5 # To avoid division by zero or precision loss
|
||||
projection = (pos_before[ibeg] + relpos * (pos_after[iend] - pos_before[ibeg]))
|
||||
dist_from_proj = np.sqrt(((projection - step) ** 2).sum(0))
|
||||
if dist_from_proj > 0.001: # Move central point only if points are not aligned
|
||||
if dist_from_proj > 0.0003: # Move central point only if points are not aligned
|
||||
modif_seq[i] = (step - (self.wc_stretch / dist_from_proj)
|
||||
* (projection - step))
|
||||
|
||||
return
|
||||
|
||||
def wideTurn(self, orig_seq, modif_seq):
|
||||
@ -411,8 +413,6 @@ class Stretcher():
|
||||
modif_seq[ibeg] = modif_seq[ibeg] + xperp * self.pw_stretch
|
||||
elif not materialleft and materialright:
|
||||
modif_seq[ibeg] = modif_seq[ibeg] - xperp * self.pw_stretch
|
||||
if materialleft and materialright:
|
||||
modif_seq[ibeg] = orig_seq[ibeg] # Surrounded by walls, don't move
|
||||
|
||||
# Setup part of the stretch plugin
|
||||
class Stretch(Script):
|
||||
@ -437,7 +437,7 @@ class Stretch(Script):
|
||||
"description": "Distance by which the points are moved by the correction effect in corners. The higher this value, the higher the effect",
|
||||
"unit": "mm",
|
||||
"type": "float",
|
||||
"default_value": 0.08,
|
||||
"default_value": 0.1,
|
||||
"minimum_value": 0,
|
||||
"minimum_value_warning": 0,
|
||||
"maximum_value_warning": 0.2
|
||||
@ -448,7 +448,7 @@ class Stretch(Script):
|
||||
"description": "Distance by which the points are moved by the correction effect when two lines are nearby. The higher this value, the higher the effect",
|
||||
"unit": "mm",
|
||||
"type": "float",
|
||||
"default_value": 0.08,
|
||||
"default_value": 0.1,
|
||||
"minimum_value": 0,
|
||||
"minimum_value_warning": 0,
|
||||
"maximum_value_warning": 0.2
|
||||
@ -463,7 +463,7 @@ class Stretch(Script):
|
||||
the returned string is the list of modified g-code instructions
|
||||
"""
|
||||
stretcher = Stretcher(
|
||||
Application.getInstance().getGlobalContainerStack().getProperty("line_width", "value")
|
||||
ExtruderManager.getInstance().getActiveExtruderStack().getProperty("machine_nozzle_size", "value")
|
||||
, self.getSettingValueByKey("wc_stretch"), self.getSettingValueByKey("pw_stretch"))
|
||||
return stretcher.execute(data)
|
||||
|
||||
|
@ -111,12 +111,12 @@ UM.Dialog
|
||||
height: childrenRect.height
|
||||
Label
|
||||
{
|
||||
text: catalog.i18nc("@action:label", "Name")
|
||||
text: catalog.i18nc("@action:label", Cura.MachineManager.activeMachineNetworkGroupName != "" ? "Printer Group" : "Name")
|
||||
width: (parent.width / 3) | 0
|
||||
}
|
||||
Label
|
||||
{
|
||||
text: Cura.MachineManager.activeMachineName
|
||||
text: Cura.MachineManager.activeMachineNetworkGroupName != "" ? Cura.MachineManager.activeMachineNetworkGroupName : Cura.MachineManager.activeMachineName
|
||||
width: (parent.width / 3) | 0
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user