From 0fcf8bb97ced8df552cd0283b4ea009b6ca42623 Mon Sep 17 00:00:00 2001 From: Andreas Date: Thu, 21 Oct 2021 16:24:40 +0200 Subject: added tangential and guided fill --- lib/svg/tags.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'lib/svg') diff --git a/lib/svg/tags.py b/lib/svg/tags.py index 8b6f02a4..f3118661 100644 --- a/lib/svg/tags.py +++ b/lib/svg/tags.py @@ -11,7 +11,6 @@ inkex.NSS['inkstitch'] = 'http://inkstitch.org/namespace' SVG_PATH_TAG = inkex.addNS('path', 'svg') SVG_POLYLINE_TAG = inkex.addNS('polyline', 'svg') -SVG_POLYGON_TAG = inkex.addNS('polygon', 'svg') SVG_RECT_TAG = inkex.addNS('rect', 'svg') SVG_ELLIPSE_TAG = inkex.addNS('ellipse', 'svg') SVG_CIRCLE_TAG = inkex.addNS('circle', 'svg') @@ -23,15 +22,12 @@ SVG_LINK_TAG = inkex.addNS('a', 'svg') SVG_SYMBOL_TAG = inkex.addNS('symbol', 'svg') SVG_USE_TAG = inkex.addNS('use', 'svg') SVG_IMAGE_TAG = inkex.addNS('image', 'svg') -SVG_CLIPPATH_TAG = inkex.addNS('clipPath', 'svg') -SVG_MASK_TAG = inkex.addNS('mask', 'svg') INKSCAPE_LABEL = inkex.addNS('label', 'inkscape') INKSCAPE_GROUPMODE = inkex.addNS('groupmode', 'inkscape') CONNECTION_START = inkex.addNS('connection-start', 'inkscape') CONNECTION_END = inkex.addNS('connection-end', 'inkscape') CONNECTOR_TYPE = inkex.addNS('connector-type', 'inkscape') -INKSCAPE_DOCUMENT_UNITS = inkex.addNS('document-units', 'inkscape') XLINK_HREF = inkex.addNS('href', 'xlink') @@ -41,8 +37,7 @@ SODIPODI_ROLE = inkex.addNS('role', 'sodipodi') INKSTITCH_LETTERING = inkex.addNS('lettering', 'inkstitch') -EMBROIDERABLE_TAGS = (SVG_PATH_TAG, SVG_POLYLINE_TAG, SVG_POLYGON_TAG, - SVG_RECT_TAG, SVG_ELLIPSE_TAG, SVG_CIRCLE_TAG) +EMBROIDERABLE_TAGS = (SVG_PATH_TAG, SVG_POLYLINE_TAG, SVG_RECT_TAG, SVG_ELLIPSE_TAG, SVG_CIRCLE_TAG) NOT_EMBROIDERABLE_TAGS = (SVG_IMAGE_TAG, SVG_TEXT_TAG) SVG_OBJECT_TAGS = (SVG_ELLIPSE_TAG, SVG_CIRCLE_TAG, SVG_RECT_TAG) @@ -57,6 +52,10 @@ inkstitch_attribs = [ # fill 'angle', 'auto_fill', + 'fill_method', + 'tangential_strategy', + 'join_style', + 'interlaced', 'expand_mm', 'fill_underlay', 'fill_underlay_angle', -- cgit v1.2.3 From 6916a3371695205ca388daa37e3b9a0cc8d51de6 Mon Sep 17 00:00:00 2001 From: Andreas Date: Sun, 20 Mar 2022 17:15:39 +0100 Subject: bug fixing + introduction of min_stitch_distance parameter --- lib/svg/tags.py | 1 + 1 file changed, 1 insertion(+) (limited to 'lib/svg') diff --git a/lib/svg/tags.py b/lib/svg/tags.py index f3118661..37eb5752 100644 --- a/lib/svg/tags.py +++ b/lib/svg/tags.py @@ -64,6 +64,7 @@ inkstitch_attribs = [ 'fill_underlay_row_spacing_mm', 'fill_underlay_skip_last', 'max_stitch_length_mm', + 'min_stitch_length_mm', 'row_spacing_mm', 'end_row_spacing_mm', 'skip_last', -- cgit v1.2.3 From bd8cb0d1ff2ce1f17ed8d3a5eaca19f8e8652ad0 Mon Sep 17 00:00:00 2001 From: Lex Neva Date: Mon, 2 May 2022 14:38:33 -0400 Subject: use running_stitch instead for guided fill --- lib/svg/path.py | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'lib/svg') diff --git a/lib/svg/path.py b/lib/svg/path.py index c33a7a8f..6c2cbe35 100644 --- a/lib/svg/path.py +++ b/lib/svg/path.py @@ -74,6 +74,12 @@ def get_correction_transform(node, child=False): def line_strings_to_csp(line_strings): + try: + # This lets us accept a MultiLineString or a list. + line_strings = line_strings.geoms + except AttributeError: + pass + return point_lists_to_csp(ls.coords for ls in line_strings) -- cgit v1.2.3 From 76ab3197317f258ede1bd98195535f33b856b3fd Mon Sep 17 00:00:00 2001 From: Lex Neva Date: Mon, 2 May 2022 15:00:52 -0400 Subject: add avoid_self_Crossing option --- lib/svg/tags.py | 111 ++++++++++++++++++++++++++++---------------------------- 1 file changed, 56 insertions(+), 55 deletions(-) (limited to 'lib/svg') diff --git a/lib/svg/tags.py b/lib/svg/tags.py index 37eb5752..3f412c2e 100644 --- a/lib/svg/tags.py +++ b/lib/svg/tags.py @@ -43,60 +43,61 @@ SVG_OBJECT_TAGS = (SVG_ELLIPSE_TAG, SVG_CIRCLE_TAG, SVG_RECT_TAG) INKSTITCH_ATTRIBS = {} inkstitch_attribs = [ - 'ties', - 'force_lock_stitches', - # clone - 'clone', - # polyline - 'polyline', - # fill - 'angle', - 'auto_fill', - 'fill_method', - 'tangential_strategy', - 'join_style', - 'interlaced', - 'expand_mm', - 'fill_underlay', - 'fill_underlay_angle', - 'fill_underlay_inset_mm', - 'fill_underlay_max_stitch_length_mm', - 'fill_underlay_row_spacing_mm', - 'fill_underlay_skip_last', - 'max_stitch_length_mm', - 'min_stitch_length_mm', - 'row_spacing_mm', - 'end_row_spacing_mm', - 'skip_last', - 'staggers', - 'underlay_underpath', - 'underpath', - 'flip', - 'expand_mm', - # stroke - 'manual_stitch', - 'bean_stitch_repeats', - 'repeats', - 'running_stitch_length_mm', - # satin column - 'satin_column', - 'running_stitch_length_mm', - 'center_walk_underlay', - 'center_walk_underlay_stitch_length_mm', - 'contour_underlay', - 'contour_underlay_stitch_length_mm', - 'contour_underlay_inset_mm', - 'zigzag_underlay', - 'zigzag_spacing_mm', - 'zigzag_underlay_inset_mm', - 'zigzag_underlay_spacing_mm', - 'zigzag_underlay_max_stitch_length_mm', - 'e_stitch', - 'pull_compensation_mm', - 'stroke_first', - # Legacy - 'trim_after', - 'stop_after' - ] + 'ties', + 'force_lock_stitches', + # clone + 'clone', + # polyline + 'polyline', + # fill + 'angle', + 'auto_fill', + 'fill_method', + 'tangential_strategy', + 'join_style', + 'interlaced', + 'avoid_self_crossing', + 'expand_mm', + 'fill_underlay', + 'fill_underlay_angle', + 'fill_underlay_inset_mm', + 'fill_underlay_max_stitch_length_mm', + 'fill_underlay_row_spacing_mm', + 'fill_underlay_skip_last', + 'max_stitch_length_mm', + 'min_stitch_length_mm', + 'row_spacing_mm', + 'end_row_spacing_mm', + 'skip_last', + 'staggers', + 'underlay_underpath', + 'underpath', + 'flip', + 'expand_mm', + # stroke + 'manual_stitch', + 'bean_stitch_repeats', + 'repeats', + 'running_stitch_length_mm', + # satin column + 'satin_column', + 'running_stitch_length_mm', + 'center_walk_underlay', + 'center_walk_underlay_stitch_length_mm', + 'contour_underlay', + 'contour_underlay_stitch_length_mm', + 'contour_underlay_inset_mm', + 'zigzag_underlay', + 'zigzag_spacing_mm', + 'zigzag_underlay_inset_mm', + 'zigzag_underlay_spacing_mm', + 'zigzag_underlay_max_stitch_length_mm', + 'e_stitch', + 'pull_compensation_mm', + 'stroke_first', + # Legacy + 'trim_after', + 'stop_after' +] for attrib in inkstitch_attribs: INKSTITCH_ATTRIBS[attrib] = inkex.addNS(attrib, 'inkstitch') -- cgit v1.2.3 From 68ee0eea8733d613543a28627bd21a4481da8b46 Mon Sep 17 00:00:00 2001 From: Lex Neva Date: Mon, 2 May 2022 23:48:46 -0400 Subject: add clockwise option --- lib/svg/tags.py | 1 + 1 file changed, 1 insertion(+) (limited to 'lib/svg') diff --git a/lib/svg/tags.py b/lib/svg/tags.py index 3f412c2e..02340aa5 100644 --- a/lib/svg/tags.py +++ b/lib/svg/tags.py @@ -57,6 +57,7 @@ inkstitch_attribs = [ 'join_style', 'interlaced', 'avoid_self_crossing', + 'clockwise', 'expand_mm', 'fill_underlay', 'fill_underlay_angle', -- cgit v1.2.3 From e65aaebbcab1ca6fbcf99d9f3665af423e02c2f5 Mon Sep 17 00:00:00 2001 From: Kaalleen Date: Wed, 4 May 2022 20:04:39 +0200 Subject: rebase corrections --- lib/svg/tags.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'lib/svg') diff --git a/lib/svg/tags.py b/lib/svg/tags.py index 02340aa5..0c5ffd3d 100644 --- a/lib/svg/tags.py +++ b/lib/svg/tags.py @@ -3,14 +3,16 @@ # Copyright (c) 2010 Authors # Licensed under the GNU GPL version 3.0 or later. See the file LICENSE for details. -import inkex from lxml import etree +import inkex + etree.register_namespace("inkstitch", "http://inkstitch.org/namespace") inkex.NSS['inkstitch'] = 'http://inkstitch.org/namespace' SVG_PATH_TAG = inkex.addNS('path', 'svg') SVG_POLYLINE_TAG = inkex.addNS('polyline', 'svg') +SVG_POLYGON_TAG = inkex.addNS('polygon', 'svg') SVG_RECT_TAG = inkex.addNS('rect', 'svg') SVG_ELLIPSE_TAG = inkex.addNS('ellipse', 'svg') SVG_CIRCLE_TAG = inkex.addNS('circle', 'svg') @@ -22,12 +24,15 @@ SVG_LINK_TAG = inkex.addNS('a', 'svg') SVG_SYMBOL_TAG = inkex.addNS('symbol', 'svg') SVG_USE_TAG = inkex.addNS('use', 'svg') SVG_IMAGE_TAG = inkex.addNS('image', 'svg') +SVG_CLIPPATH_TAG = inkex.addNS('clipPath', 'svg') +SVG_MASK_TAG = inkex.addNS('mask', 'svg') INKSCAPE_LABEL = inkex.addNS('label', 'inkscape') INKSCAPE_GROUPMODE = inkex.addNS('groupmode', 'inkscape') CONNECTION_START = inkex.addNS('connection-start', 'inkscape') CONNECTION_END = inkex.addNS('connection-end', 'inkscape') CONNECTOR_TYPE = inkex.addNS('connector-type', 'inkscape') +INKSCAPE_DOCUMENT_UNITS = inkex.addNS('document-units', 'inkscape') XLINK_HREF = inkex.addNS('href', 'xlink') @@ -37,7 +42,8 @@ SODIPODI_ROLE = inkex.addNS('role', 'sodipodi') INKSTITCH_LETTERING = inkex.addNS('lettering', 'inkstitch') -EMBROIDERABLE_TAGS = (SVG_PATH_TAG, SVG_POLYLINE_TAG, SVG_RECT_TAG, SVG_ELLIPSE_TAG, SVG_CIRCLE_TAG) +EMBROIDERABLE_TAGS = (SVG_PATH_TAG, SVG_POLYLINE_TAG, SVG_POLYGON_TAG, + SVG_RECT_TAG, SVG_ELLIPSE_TAG, SVG_CIRCLE_TAG) NOT_EMBROIDERABLE_TAGS = (SVG_IMAGE_TAG, SVG_TEXT_TAG) SVG_OBJECT_TAGS = (SVG_ELLIPSE_TAG, SVG_CIRCLE_TAG, SVG_RECT_TAG) -- cgit v1.2.3 From a275d49a24dc91b734c6dbee1e29157bfd0d59d5 Mon Sep 17 00:00:00 2001 From: Lex Neva Date: Thu, 5 May 2022 22:53:31 -0400 Subject: tangential->contour, fix legacy, remove unused params --- lib/svg/tags.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'lib/svg') diff --git a/lib/svg/tags.py b/lib/svg/tags.py index 0c5ffd3d..d78ba678 100644 --- a/lib/svg/tags.py +++ b/lib/svg/tags.py @@ -59,9 +59,8 @@ inkstitch_attribs = [ 'angle', 'auto_fill', 'fill_method', - 'tangential_strategy', + 'contour_strategy', 'join_style', - 'interlaced', 'avoid_self_crossing', 'clockwise', 'expand_mm', @@ -72,7 +71,6 @@ inkstitch_attribs = [ 'fill_underlay_row_spacing_mm', 'fill_underlay_skip_last', 'max_stitch_length_mm', - 'min_stitch_length_mm', 'row_spacing_mm', 'end_row_spacing_mm', 'skip_last', -- cgit v1.2.3