diff options
| author | Lex Neva <github.com@lexneva.name> | 2018-07-30 16:40:26 -0400 |
|---|---|---|
| committer | Lex Neva <github.com@lexneva.name> | 2018-07-30 16:40:26 -0400 |
| commit | d224b2655eb5287c132bd4b3e4bf7129b17f597f (patch) | |
| tree | ef54cf8d721f59901efe48bffdb31272b2359732 | |
| parent | 8bf478a71a49b93269da438cf1fcdb6d2e0e0942 (diff) | |
fix handling of self-intersection
| -rw-r--r-- | lib/extensions/convert_to_satin.py | 6 | ||||
| -rw-r--r-- | messages.po | 8 |
2 files changed, 10 insertions, 4 deletions
diff --git a/lib/extensions/convert_to_satin.py b/lib/extensions/convert_to_satin.py index 53930935..8ec6ab2e 100644 --- a/lib/extensions/convert_to_satin.py +++ b/lib/extensions/convert_to_satin.py @@ -5,6 +5,7 @@ import numpy from numpy import diff, sign, setdiff1d from scipy.signal import argrelmin import math +from copy import deepcopy from .base import InkstitchExtension from ..svg.tags import SVG_PATH_TAG @@ -40,6 +41,11 @@ class ConvertToSatin(InkstitchExtension): except ValueError: inkex.errormsg(_("Cannot convert %s to a satin column because it intersects itself. Try breaking it up into multiple paths.") % element.node.get('id')) + # revert any changes we've made + self.document = deepcopy(self.original_document) + + return + parent.insert(index, self.satin_to_svg_node(rails, rungs, correction_transform)) parent.remove(element.node) diff --git a/messages.po b/messages.po index da2748b1..e885ac22 100644 --- a/messages.po +++ b/messages.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PROJECT VERSION\n" "Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" -"POT-Creation-Date: 2018-07-30 16:03-0400\n" +"POT-Creation-Date: 2018-07-30 16:40-0400\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Language-Team: LANGUAGE <LL@li.org>\n" @@ -238,17 +238,17 @@ msgstr "" msgid "Please choose one or more commands to attach." msgstr "" -#: lib/extensions/convert_to_satin.py:24 +#: lib/extensions/convert_to_satin.py:25 msgid "Please select at least one line to convert to a satin column." msgstr "" #. : Convert To Satin extension, user selected one or more objects that were #. not lines. -#: lib/extensions/convert_to_satin.py:29 +#: lib/extensions/convert_to_satin.py:30 msgid "Only simple lines may be converted to satin columns." msgstr "" -#: lib/extensions/convert_to_satin.py:41 +#: lib/extensions/convert_to_satin.py:42 #, python-format msgid "" "Cannot convert %s to a satin column because it intersects itself. Try " |
