From febf98a2d30fb74a1c2f6b35f0932be5664161f6 Mon Sep 17 00:00:00 2001 From: Lex Neva Date: Tue, 30 Apr 2019 19:46:12 -0400 Subject: add grbl laser options for g-code output --- lib/extensions/output.py | 2 +- lib/stitch_plan/stitch_plan.py | 12 +++++++----- pyembroidery | 2 +- templates/output_params_txt.xml | 11 ++++++++--- 4 files changed, 17 insertions(+), 10 deletions(-) diff --git a/lib/extensions/output.py b/lib/extensions/output.py index 8b99c027..ccf4d7cb 100644 --- a/lib/extensions/output.py +++ b/lib/extensions/output.py @@ -46,7 +46,7 @@ class Output(InkstitchExtension): return patches = self.elements_to_patches(self.elements) - stitch_plan = patches_to_stitch_plan(patches) + stitch_plan = patches_to_stitch_plan(patches, disable_ties=self.settings.get('laser_mode', False)) temp_file = tempfile.NamedTemporaryFile(suffix=".%s" % self.file_extension, delete=False) diff --git a/lib/stitch_plan/stitch_plan.py b/lib/stitch_plan/stitch_plan.py index 808fa626..b55ccc1f 100644 --- a/lib/stitch_plan/stitch_plan.py +++ b/lib/stitch_plan/stitch_plan.py @@ -1,11 +1,11 @@ -from .stitch import Stitch -from .ties import add_ties from ..svg import PIXELS_PER_MM -from ..utils.geometry import Point from ..threads import ThreadColor +from ..utils.geometry import Point +from .stitch import Stitch +from .ties import add_ties -def patches_to_stitch_plan(patches, collapse_len=3.0 * PIXELS_PER_MM): +def patches_to_stitch_plan(patches, collapse_len=3.0 * PIXELS_PER_MM, disable_ties=False): """Convert a collection of inkstitch.element.Patch objects to a StitchPlan. * applies instructions embedded in the Patch such as trim_after and stop_after @@ -56,7 +56,9 @@ def patches_to_stitch_plan(patches, collapse_len=3.0 * PIXELS_PER_MM): del stitch_plan.color_blocks[-1] stitch_plan.filter_duplicate_stitches() - stitch_plan.add_ties() + + if not disable_ties: + stitch_plan.add_ties() return stitch_plan diff --git a/pyembroidery b/pyembroidery index 47b795a0..6d14167c 160000 --- a/pyembroidery +++ b/pyembroidery @@ -1 +1 @@ -Subproject commit 47b795a084bdc3281fbf944b940609bf86193fd8 +Subproject commit 6d14167c94bb63f4f1536f9467945e2e7beb4357 diff --git a/templates/output_params_txt.xml b/templates/output_params_txt.xml index 3b78df3b..767ddc1a 100644 --- a/templates/output_params_txt.xml +++ b/templates/output_params_txt.xml @@ -1,4 +1,9 @@ {# these parameters are for g-code files (*.txt) #} - false - false - 5.0 + false + false + false + 5.0 + -1 + -1 + -1 + -1 \ No newline at end of file -- cgit v1.2.3