Skip to content

Commit

Permalink
Merge branch 'main' into CURA-12335_expose-bottom-skin-settings
Browse files Browse the repository at this point in the history
  • Loading branch information
HellAholic authored Feb 14, 2025
2 parents 479c34c + 93f510f commit 84b60cb
Show file tree
Hide file tree
Showing 194 changed files with 4,213 additions and 136 deletions.
6 changes: 3 additions & 3 deletions conandata.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ requirements:
- "curaengine/5.10.0-alpha.0@ultimaker/testing"
- "cura_binary_data/5.10.0-alpha.0@ultimaker/testing"
- "fdm_materials/5.10.0-alpha.0@ultimaker/testing"
- "dulcificum/0.3.0@ultimaker/stable"
- "pysavitar/5.4.0-alpha.0@ultimaker/stable"
- "pynest2d/5.4.0-alpha.0@ultimaker/stable"
- "dulcificum/5.10.0@ultimaker/stable"
- "pysavitar/5.10.0@ultimaker/stable"
- "pynest2d/5.10.0@ultimaker/stable"
requirements_internal:
- "fdm_materials/5.10.0-alpha.0@internal/testing"
- "cura_private_data/5.10.0-alpha.0@internal/testing"
Expand Down
1 change: 0 additions & 1 deletion conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ class CuraConan(ConanFile):
generators = "VirtualPythonEnv"
tool_requires = "gettext/0.22.5"

# FIXME: Remove specific branch once merged to main
python_requires = "translationextractor/[>=2.2.0]@ultimaker/stable"

options = {
Expand Down
9 changes: 7 additions & 2 deletions cura/PrinterOutput/FormatMaps.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ class FormatMaps:
"fire_e": "ultimaker_method",
"lava_f": "ultimaker_methodx",
"magma_10": "ultimaker_methodxl",
"sketch": "ultimaker_sketch"
"sketch": "ultimaker_sketch",
"sketch_large": "ultimaker_sketch_large",
"sketch_sprint": "ultimaker_sketch_sprint"
}

# A map from the extruder-name in their native file-formats to the internal name we use.
Expand All @@ -23,7 +25,10 @@ class FormatMaps:
"mk14_c": "1C",
"mk14": "1A",
"mk14_s": "2A",
"mk14_e": "LABS"
"mk14_e": "LABS",
"sketch_extruder": "0.4mm",
"sketch_l_extruder": "0.4mm",
"sketch_sprint_extruder": "0.4mm",
}

# A map from the material-name in their native file-formats to some info, including the internal name we use.
Expand Down
2 changes: 1 addition & 1 deletion cura/Settings/MachineManager.py
Original file line number Diff line number Diff line change
Expand Up @@ -1678,7 +1678,7 @@ def activeQualityDisplayNameMap(self) -> ActiveQuality:
intent_category = self.activeIntentCategory,
intent_name = IntentCategoryModel.translation(self.activeIntentCategory, "name", self.activeIntentCategory.title()),
custom_profile = self.activeQualityOrQualityChangesName if global_stack.qualityChanges is not empty_quality_changes_container else None,
layer_height = self.activeQualityLayerHeight if self.isActiveQualitySupported else None,
layer_height = float("{:.2f}".format(self.activeQualityLayerHeight)) if self.isActiveQualitySupported else None,
is_experimental = self.isActiveQualityExperimental and self.isActiveQualitySupported
)

Expand Down
4 changes: 2 additions & 2 deletions packaging/AppImage/cura.desktop.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ GenericName=3D Printing Software
GenericName[de]=3D-Druck-Software
GenericName[nl]=3D-Print Software
Comment=Cura converts 3D models into paths for a 3D printer. It prepares your print for maximum accuracy, minimum printing time and good reliability with many extra features that make your print come out great.
Exec=UltiMaker-Cura %F
Exec=UltiMaker-Cura %U
Icon=cura-icon
Terminal=false
Type=Application
MimeType=model/stl;application/vnd.ms-3mfdocument;application/prs.wavefront-obj;image/bmp;image/gif;image/jpeg;image/png;text/x-gcode;application/x-amf;application/x-ply;application/x-ctm;model/vnd.collada+xml;model/gltf-binary;model/gltf+json;model/vnd.collada+xml+zip;
MimeType=model/stl;application/vnd.ms-3mfdocument;model/3mf;application/prs.wavefront-obj;image/bmp;image/gif;image/jpeg;image/png;text/x-gcode;application/x-amf;application/x-ply;application/x-ctm;model/vnd.collada+xml;model/gltf-binary;model/gltf+json;model/vnd.collada+xml+zip;x-scheme-handler/cura;
Categories=Graphics;
Keywords=3D;Printing;
X-AppImage-Version={{ cura_version }}
78 changes: 77 additions & 1 deletion plugins/MakerbotWriter/MakerbotWriter.py
Original file line number Diff line number Diff line change
Expand Up @@ -258,11 +258,87 @@ def _getMeta(self, root_nodes: List[SceneNode]) -> Tuple[Dict[str, any], str]:

meta["preferences"] = dict()
bounds = application.getBuildVolume().getBoundingBox()
intent = CuraApplication.getInstance().getIntentManager().currentIntentCategory
meta["preferences"]["instance0"] = {
"machineBounds": [bounds.right, bounds.front, bounds.left, bounds.back] if bounds is not None else None,
"printMode": CuraApplication.getInstance().getIntentManager().currentIntentCategory,
"printMode": intent
}

if file_format == "application/x-makerbot":
accel_overrides = meta["accel_overrides"] = {}
if intent in ['highspeed', 'highspeedsolid']:
accel_overrides['do_input_shaping'] = True
accel_overrides['do_corner_rounding'] = True
bead_mode_overrides = accel_overrides["bead_mode"] = {}

accel_enabled = global_stack.getProperty('acceleration_enabled', 'value')

if accel_enabled:
global_accel_setting = global_stack.getProperty('acceleration_print', 'value')
accel_overrides["rate_mm_per_s_sq"] = {
"x": global_accel_setting,
"y": global_accel_setting
}

if global_stack.getProperty('acceleration_travel_enabled', 'value'):
travel_accel_setting = global_stack.getProperty('acceleration_travel', 'value')
bead_mode_overrides['Travel Move'] = {
"rate_mm_per_s_sq": {
"x": travel_accel_setting,
"y": travel_accel_setting
}
}

jerk_enabled = global_stack.getProperty('jerk_enabled', 'value')
if jerk_enabled:
global_jerk_setting = global_stack.getProperty('jerk_print', 'value')
accel_overrides["max_speed_change_mm_per_s"] = {
"x": global_jerk_setting,
"y": global_jerk_setting
}

if global_stack.getProperty('jerk_travel_enabled', 'value'):
travel_jerk_setting = global_stack.getProperty('jerk_travel', 'value')
if 'Travel Move' not in bead_mode_overrides:
bead_mode_overrides['Travel Move' ] = {}
bead_mode_overrides['Travel Move'].update({
"max_speed_change_mm_per_s": {
"x": travel_jerk_setting,
"y": travel_jerk_setting
}
})


# Get bead mode settings per extruder
available_bead_modes = {
"infill": "FILL",
"prime_tower": "PRIME_TOWER",
"roofing": "TOP_SURFACE",
"support_infill": "SUPPORT",
"support_interface": "SUPPORT_INTERFACE",
"wall_0": "WALL_OUTER",
"wall_x": "WALL_INNER",
"skirt_brim": "SKIRT"
}
for idx, extruder in enumerate(extruders):
for bead_mode_setting, bead_mode_tag in available_bead_modes.items():
ext_specific_tag = "%s_%s" % (bead_mode_tag, idx)
if accel_enabled or jerk_enabled:
bead_mode_overrides[ext_specific_tag] = {}

if accel_enabled:
accel_val = extruder.getProperty('acceleration_%s' % bead_mode_setting, 'value')
bead_mode_overrides[ext_specific_tag]["rate_mm_per_s_sq"] = {
"x": accel_val,
"y": accel_val
}
if jerk_enabled:
jerk_val = extruder.getProperty('jerk_%s' % bead_mode_setting, 'value')
bead_mode_overrides[ext_specific_tag][ "max_speed_change_mm_per_s"] = {
"x": jerk_val,
"y": jerk_val
}

meta["miracle_config"] = {"gaggles": {"instance0": {}}}

version_info = dict()
Expand Down
2 changes: 1 addition & 1 deletion plugins/PostProcessingPlugin/Script.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ def getValue(self, line: str, key: str, default = None) -> Any:
if not key in line or (';' in line and line.find(key) > line.find(';')):
return default
sub_part = line[line.find(key) + 1:]
m = re.search('^-?[0-9]+\.?[0-9]*', sub_part)
m = re.search(r'^-?[0-9]+\.?[0-9]*', sub_part)
if m is None:
return default
try:
Expand Down
2 changes: 1 addition & 1 deletion plugins/PostProcessingPlugin/scripts/PauseAtHeight.py
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ def execute(self, data: List[str]) -> List[str]:
nbr_negative_layers += 1

#Track the latest printing temperature in order to resume at the correct temperature.
if re.match("T(\d*)", line):
if re.match(r"T(\d*)", line):
current_t = self.getValue(line, "T")
m = self.getValue(line, "M")
if m is not None and (m == 104 or m == 109) and self.getValue(line, "S") is not None:
Expand Down
2 changes: 1 addition & 1 deletion plugins/UM3NetworkPrinting/src/Cloud/CloudOutputDevice.py
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ def isMethod(self) -> bool:
return False

[printer, *_] = self._printers
return printer.type in ("MakerBot Method X", "MakerBot Method XL", "MakerBot Sketch")
return printer.type in ("MakerBot Method", "MakerBot Method X", "MakerBot Method XL", "MakerBot Sketch", "MakerBot Sketch Large", "MakerBot Sketch Sprint")

@pyqtProperty(bool, notify=_cloudClusterPrintersChanged)
def supportsPrintJobActions(self) -> bool:
Expand Down
4 changes: 3 additions & 1 deletion plugins/UM3NetworkPrinting/src/Cloud/machine_id_to_name.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,7 @@
"ultimaker_methodx": "MakerBot Method X",
"ultimaker_methodxl": "MakerBot Method XL",
"ultimaker_factor4": "Ultimaker Factor 4",
"ultimaker_sketch": "MakerBot Sketch"
"ultimaker_sketch": "MakerBot Sketch",
"ultimaker_sketch_large": "MakerBot Sketch Large",
"ultimaker_sketch_sprint": "MakerBot Sketch Sprint"
}
2 changes: 1 addition & 1 deletion plugins/UM3NetworkPrinting/src/ExportFileJob.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def __init__(self, file_handler: Optional[FileHandler], nodes: List[SceneNode],

# Determine the filename.
job_name = CuraApplication.getInstance().getPrintInformation().jobName
job_name = re.sub("[^\w\-. ()]", "-", job_name)
job_name = re.sub(r"[^\w\-. ()]", "-", job_name)
extension = self._mesh_format_handler.preferred_format.get("extension", "")
self.setFileName("{}.{}".format(job_name, extension))

Expand Down
4 changes: 4 additions & 0 deletions plugins/USBPrinting/USBPrinterOutputDevice.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,8 @@ def __init__(self, serial_port: str, baud_rate: Optional[int] = None) -> None:

CuraApplication.getInstance().getOnExitCallbackManager().addCallback(self._checkActivePrintingUponAppExit)

CuraApplication.getInstance().getPreferences().addPreference("usb_printing/enabled", False)

# This is a callback function that checks if there is any printing in progress via USB when the application tries
# to exit. If so, it will show a confirmation before
def _checkActivePrintingUponAppExit(self) -> None:
Expand Down Expand Up @@ -144,6 +146,8 @@ def requestWrite(self, nodes: List["SceneNode"], file_name: Optional[str] = None

CuraApplication.getInstance().getController().setActiveStage("MonitorStage")

CuraApplication.getInstance().getPreferences().setValue("usb_printing/enabled", True)

#Find the g-code to print.
gcode_textio = StringIO()
gcode_writer = cast(MeshWriter, PluginRegistry.getInstance().getPluginObject("GCodeWriter"))
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
import configparser
import io
from typing import Dict, Tuple, List

from UM.VersionUpgrade import VersionUpgrade

_RENAMED_SETTINGS = {
"wall_overhang_speed_factor": "wall_overhang_speed_factors"
} # type: Dict[str, str]

_NEW_SETTING_VERSION = "25"


class VersionUpgrade59to510(VersionUpgrade):
def upgradePreferences(self, serialized: str, filename: str):
parser = configparser.ConfigParser(interpolation = None)
parser.read_string(serialized)

# Fix 'renamed'(ish) settings for visibility
if "visible_settings" in parser["general"]:
all_setting_keys = parser["general"]["visible_settings"].strip().split(";")
if all_setting_keys:
for idx, key in enumerate(all_setting_keys):
if key in _RENAMED_SETTINGS:
all_setting_keys[idx] = _RENAMED_SETTINGS[key]
parser["general"]["visible_settings"] = ";".join(all_setting_keys)

# Update version number.
parser["metadata"]["setting_version"] = _NEW_SETTING_VERSION

result = io.StringIO()
parser.write(result)
return [filename], [result.getvalue()]

def upgradeInstanceContainer(self, serialized: str, filename: str) -> Tuple[List[str], List[str]]:
parser = configparser.ConfigParser(interpolation = None, comment_prefixes = ())
parser.read_string(serialized)

# Update version number.
parser["metadata"]["setting_version"] = _NEW_SETTING_VERSION

if "values" in parser:
for old_name, new_name in _RENAMED_SETTINGS.items():
if old_name in parser["values"]:
parser["values"][new_name] = parser["values"][old_name]
del parser["values"][old_name]
if "wall_overhang_speed_factors" in parser["values"]:
old_value = float(parser["values"]["wall_overhang_speed_factors"])
new_value = [max(1, int(round(old_value)))]
parser["values"]["wall_overhang_speed_factor"] = str(new_value)

result = io.StringIO()
parser.write(result)
return [filename], [result.getvalue()]

def upgradeStack(self, serialized: str, filename: str) -> Tuple[List[str], List[str]]:
parser = configparser.ConfigParser(interpolation = None)
parser.read_string(serialized)

# Update version number.
if "metadata" not in parser:
parser["metadata"] = {}

parser["metadata"]["setting_version"] = _NEW_SETTING_VERSION

result = io.StringIO()
parser.write(result)
return [filename], [result.getvalue()]
60 changes: 60 additions & 0 deletions plugins/VersionUpgrade/VersionUpgrade59to510/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
# Copyright (c) 2024 UltiMaker
# Cura is released under the terms of the LGPLv3 or higher.

from typing import Any, Dict, TYPE_CHECKING

from . import VersionUpgrade59to510

if TYPE_CHECKING:
from UM.Application import Application

upgrade = VersionUpgrade59to510.VersionUpgrade59to510()

def getMetaData() -> Dict[str, Any]:
return {
"version_upgrade": {
# From To Upgrade function
("preferences", 7000024): ("preferences", 7000025, upgrade.upgradePreferences),
("machine_stack", 6000024): ("machine_stack", 6000025, upgrade.upgradeStack),
("extruder_train", 6000024): ("extruder_train", 6000025, upgrade.upgradeStack),
("definition_changes", 4000024): ("definition_changes", 4000025, upgrade.upgradeInstanceContainer),
("quality_changes", 4000024): ("quality_changes", 4000025, upgrade.upgradeInstanceContainer),
("quality", 4000024): ("quality", 4000025, upgrade.upgradeInstanceContainer),
("user", 4000024): ("user", 4000025, upgrade.upgradeInstanceContainer),
("intent", 4000024): ("intent", 4000025, upgrade.upgradeInstanceContainer),
},
"sources": {
"preferences": {
"get_version": upgrade.getCfgVersion,
"location": {"."}
},
"machine_stack": {
"get_version": upgrade.getCfgVersion,
"location": {"./machine_instances"}
},
"extruder_train": {
"get_version": upgrade.getCfgVersion,
"location": {"./extruders"}
},
"definition_changes": {
"get_version": upgrade.getCfgVersion,
"location": {"./definition_changes"}
},
"quality_changes": {
"get_version": upgrade.getCfgVersion,
"location": {"./quality_changes"}
},
"quality": {
"get_version": upgrade.getCfgVersion,
"location": {"./quality"}
},
"user": {
"get_version": upgrade.getCfgVersion,
"location": {"./user"}
}
}
}


def register(app: "Application") -> Dict[str, Any]:
return {"version_upgrade": upgrade}
8 changes: 8 additions & 0 deletions plugins/VersionUpgrade/VersionUpgrade59to510/plugin.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"name": "Version Upgrade 5.9 to 5.10",
"author": "Ultimaker B.V.",
"version": "1.0.0",
"description": "Upgrades configurations from Cura 5.9 to Cura 5.10",
"api": 8,
"i18n-catalog": "cura"
}
7 changes: 6 additions & 1 deletion resources/definitions/ankermake_m5.def.json
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,12 @@
"support_z_distance": { "value": "layer_height * 2" },
"top_bottom_thickness": { "value": "layer_height * 4" },
"wall_overhang_angle": { "value": 55 },
"wall_overhang_speed_factor": { "value": 55 },
"wall_overhang_speed_factors":
{
"value": [
55
]
},
"zig_zaggify_infill": { "value": "infill_pattern == 'cross' or infill_pattern == 'cross_3d' or infill_pattern == 'lines'" }
}
}
7 changes: 6 additions & 1 deletion resources/definitions/ankermake_m5c.def.json
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,12 @@
"wall_extruder_nr": { "value": -1 },
"wall_line_width_0": { "value": 0.44 },
"wall_overhang_angle": { "value": 45 },
"wall_overhang_speed_factor": { "value": 40 },
"wall_overhang_speed_factors":
{
"value": [
40
]
},
"wall_thickness": { "value": 0.84 },
"wall_x_extruder_nr": { "value": -1 },
"zig_zaggify_infill": { "value": true }
Expand Down
Loading

0 comments on commit 84b60cb

Please sign in to comment.