From 377b52e21e989ccf668ed1afea89a53a27903060 Mon Sep 17 00:00:00 2001 From: trouch Date: Mon, 24 Jun 2019 22:44:36 +0200 Subject: [PATCH 1/3] feat: "Z-Seam Position" presets to ease XY setting --- resources/definitions/fdmprinter.def.json | 25 +++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/resources/definitions/fdmprinter.def.json b/resources/definitions/fdmprinter.def.json index 0a26c1fc0c..a102351f2d 100644 --- a/resources/definitions/fdmprinter.def.json +++ b/resources/definitions/fdmprinter.def.json @@ -1399,6 +1399,27 @@ "limit_to_extruder": "wall_0_extruder_nr", "settable_per_mesh": true }, + "z_seam_position": + { + "label": "Z Seam Position", + "description": "The position near where to start printing each part in a layer.", + "type": "enum", + "options": + { + "backleft": "Back Left", + "back": "Back", + "backright": "Back Right", + "right": "Right", + "frontright": "Front Right", + "front": "Front", + "frontleft": "Front Left", + "left": "Left" + }, + "enabled": "z_seam_type == 'back'", + "default_value": "back", + "limit_to_extruder": "wall_0_extruder_nr", + "settable_per_mesh": true + }, "z_seam_x": { "label": "Z Seam X", @@ -1406,7 +1427,7 @@ "unit": "mm", "type": "float", "default_value": 100.0, - "value": "machine_width / 2", + "value": "0 if (z_seam_position == 'frontleft' or z_seam_position == 'left' or z_seam_position == 'backleft') else machine_width/2 if (z_seam_position == 'front' or z_seam_position == 'back') else machine_width", "enabled": "z_seam_type == 'back'", "limit_to_extruder": "wall_0_extruder_nr", "settable_per_mesh": true @@ -1418,7 +1439,7 @@ "unit": "mm", "type": "float", "default_value": 100.0, - "value": "machine_depth * 3", + "value": "0 if (z_seam_position == 'frontleft' or z_seam_position == 'front' or z_seam_position == 'frontright') else machine_depth/2 if (z_seam_position == 'left' or z_seam_position == 'right') else machine_depth", "enabled": "z_seam_type == 'back'", "limit_to_extruder": "wall_0_extruder_nr", "settable_per_mesh": true From a9540c1ff04bd98e1a8e74cefab9f0f0bddf41b0 Mon Sep 17 00:00:00 2001 From: trouch Date: Fri, 28 Jun 2019 21:41:19 +0200 Subject: [PATCH 2/3] define Z Seam X/Y as Z Seam Position children --- resources/definitions/fdmprinter.def.json | 53 ++++++++++++----------- 1 file changed, 28 insertions(+), 25 deletions(-) diff --git a/resources/definitions/fdmprinter.def.json b/resources/definitions/fdmprinter.def.json index a102351f2d..bfd0d1f73b 100644 --- a/resources/definitions/fdmprinter.def.json +++ b/resources/definitions/fdmprinter.def.json @@ -1418,31 +1418,34 @@ "enabled": "z_seam_type == 'back'", "default_value": "back", "limit_to_extruder": "wall_0_extruder_nr", - "settable_per_mesh": true - }, - "z_seam_x": - { - "label": "Z Seam X", - "description": "The X coordinate of the position near where to start printing each part in a layer.", - "unit": "mm", - "type": "float", - "default_value": 100.0, - "value": "0 if (z_seam_position == 'frontleft' or z_seam_position == 'left' or z_seam_position == 'backleft') else machine_width/2 if (z_seam_position == 'front' or z_seam_position == 'back') else machine_width", - "enabled": "z_seam_type == 'back'", - "limit_to_extruder": "wall_0_extruder_nr", - "settable_per_mesh": true - }, - "z_seam_y": - { - "label": "Z Seam Y", - "description": "The Y coordinate of the position near where to start printing each part in a layer.", - "unit": "mm", - "type": "float", - "default_value": 100.0, - "value": "0 if (z_seam_position == 'frontleft' or z_seam_position == 'front' or z_seam_position == 'frontright') else machine_depth/2 if (z_seam_position == 'left' or z_seam_position == 'right') else machine_depth", - "enabled": "z_seam_type == 'back'", - "limit_to_extruder": "wall_0_extruder_nr", - "settable_per_mesh": true + "settable_per_mesh": true, + "children": + { + "z_seam_x": + { + "label": "Z Seam X", + "description": "The X coordinate of the position near where to start printing each part in a layer.", + "unit": "mm", + "type": "float", + "default_value": 100.0, + "value": "0 if (z_seam_position == 'frontleft' or z_seam_position == 'left' or z_seam_position == 'backleft') else machine_width/2 if (z_seam_position == 'front' or z_seam_position == 'back') else machine_width", + "enabled": "z_seam_type == 'back'", + "limit_to_extruder": "wall_0_extruder_nr", + "settable_per_mesh": true + }, + "z_seam_y": + { + "label": "Z Seam Y", + "description": "The Y coordinate of the position near where to start printing each part in a layer.", + "unit": "mm", + "type": "float", + "default_value": 100.0, + "value": "0 if (z_seam_position == 'frontleft' or z_seam_position == 'front' or z_seam_position == 'frontright') else machine_depth/2 if (z_seam_position == 'left' or z_seam_position == 'right') else machine_depth", + "enabled": "z_seam_type == 'back'", + "limit_to_extruder": "wall_0_extruder_nr", + "settable_per_mesh": true + } + } }, "z_seam_corner": { From 0b27119001a26cdab60c836d611cd4ffa81937d3 Mon Sep 17 00:00:00 2001 From: Remco Burema Date: Thu, 8 Aug 2019 15:47:05 +0200 Subject: [PATCH 3/3] Fix encoding/decoding issues (Windows) for i18n import script. part of CURA-6663 --- scripts/lionbridge_import.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/scripts/lionbridge_import.py b/scripts/lionbridge_import.py index 07c5d5b66a..0c2c132216 100644 --- a/scripts/lionbridge_import.py +++ b/scripts/lionbridge_import.py @@ -2,6 +2,7 @@ # Cura is released under the terms of the LGPLv3 or higher. import argparse #To get the source directory from command line arguments. +import io # To fix encoding issues in Windows import os #To find files from the source. import os.path #To find files from the source and the destination path. @@ -34,12 +35,12 @@ def lionbridge_import(source: str) -> None: else: raise Exception("Unknown file: " + source_file + "... Is this Cura or Uranium?") - with open(os.path.join(directory, file_pot)) as f: + with io.open(os.path.join(directory, file_pot), encoding = "utf8") as f: source_str = f.read() - with open(destination_file) as f: + with io.open(destination_file, encoding = "utf8") as f: destination_str = f.read() result = merge(source_str, destination_str) - with open(destination_file, "w") as f: + with io.open(destination_file, "w", encoding = "utf8") as f: f.write(result) ## Gets the destination path to copy the translations for Cura to.