summaryrefslogtreecommitdiff
path: root/lib/commands.py
diff options
context:
space:
mode:
authorLex Neva <lexelby@users.noreply.github.com>2018-09-29 14:00:36 -0600
committerGitHub <noreply@github.com>2018-09-29 14:00:36 -0600
commit8830eb7d40befa78c24de84694c69ab958384cac (patch)
treeeff5809a68c0c37375a5e31be8ba57763938b2dd /lib/commands.py
parent5139c13fd7f43bb4d829e3c8225c51268e4d27d1 (diff)
new extension: split satin (#315)
This branch adds a new command to split a satin column at a specified point. The split happens at a stitch boundary to ensure that the two resulting satins sew just like the original. All parameters set on the original satin remain set on the two new satins, and all rungs are retained. If one of the satins would have no rungs left, a new rung is added. How to use: 1. Select a satin column (simple satin doesn't work) 2. Attach the "Satin split point" command using the "Attach commands to selected objects" extension. 3. Move the symbol (or just the connector line's endpoint) to point to the exact spot you want the satin to be split at. 4. Select the satin column again. 5. Run "Split Satin Column". 6. The split point command and connector line disappear, and nothing else appears to have happened. Select your satin and you'll see that it's been split. This extension is a by-product of my initial work on #214. Ink/Stitch will need the ability to split a satin at an arbitrary point, and I figured, why not go ahead and release that functionality as an extension while I'm at it? :)
Diffstat (limited to 'lib/commands.py')
-rw-r--r--lib/commands.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/commands.py b/lib/commands.py
index db3c8a71..df82a8c4 100644
--- a/lib/commands.py
+++ b/lib/commands.py
@@ -24,6 +24,10 @@ COMMANDS = {
# L10N command attached to an object
N_("ignore_object"): N_("Ignore this object (do not stitch)"),
+ # L10N command attached to an object
+ N_("satin_cut_point"): N_("Satin cut point (use with Cut Satin Column)"),
+
+
# L10N command that affects a layer
N_("ignore_layer"): N_("Ignore layer (do not stitch any objects in this layer)"),
@@ -34,7 +38,7 @@ COMMANDS = {
N_("stop_position"): N_("Jump destination for Stop commands (a.k.a. \"Frame Out position\")."),
}
-OBJECT_COMMANDS = ["fill_start", "fill_end", "stop", "trim", "ignore_object"]
+OBJECT_COMMANDS = ["fill_start", "fill_end", "stop", "trim", "ignore_object", "satin_cut_point"]
LAYER_COMMANDS = ["ignore_layer"]
GLOBAL_COMMANDS = ["origin", "stop_position"]
@@ -101,6 +105,8 @@ class Command(BaseCommand):
if neighbors[0][0].tag != SVG_USE_TAG:
raise CommandParseError("connector does not point to a use tag")
+ self.use = neighbors[0][0]
+
self.symbol = self.get_node_by_url(neighbors[0][0].get(XLINK_HREF))
self.parse_symbol()