rename to ink/stitch

pull/11/head
Lex Neva 2018-01-03 11:09:18 -05:00
rodzic 823a135eaf
commit f50ec5e4c4
5 zmienionych plików z 36 dodań i 35 usunięć

Wyświetl plik

@ -1,4 +1,4 @@
inkscape-embroidery: an extension for machine embroidery design using Inkscape
ink/stitch: an extension for machine embroidery design using Inkscape
Copyright (C) 2010 Jon Howell
Copyright (C) 2015 Bas Wijnen - these additions also released under AGPLv3
Copyright (C) 2015 Steven Siegl

Wyświetl plik

@ -1,7 +1,8 @@
# inkscape-embroidery: An Inkscape plugin for designing machine embroidery patterns
# ink/stitch: An Inkscape plugin for designing machine embroidery patterns
**NEW December 6, 2017:** [video demo of how to use the extension](https://www.youtube.com/watch?v=qXntE1X1RIw)
**NEW January 3, 2018:** Project renamed from `inkscape-embroidery` to **ink/stitch**
**NEW January 1, 2018:** [video demo of the new live stitch preview feature](https://youtu.be/QY9NcLN3oJM)
**NEW December 6, 2017:** [video demo of how to use the extension](https://www.youtube.com/watch?v=qXntE1X1RIw)
## Introduction
**Want to design embroidery pattern files (PES, DST, etc) using free, open source software? Hate all the other options? Try this one.**
@ -10,11 +11,11 @@ I received a really wonderful christmas gift for a geeky programmer hacker: an [
So I wrote one.
Okay, not really. I'm pretty terrible at GUIs, but I found this nifty inkscape extension that was created and hacked on by a couple of other folks. It was pretty rudimentary, but it got the job done, and more importantly, it was super hackable. I hacked the hell out of it, and at this point **inkscape-embroidery is a viable entry-level machine embroidery design tool**.
Okay, not really. I'm pretty terrible at GUIs, but I found this nifty inkscape extension that was created and hacked on by a couple of other folks. It was pretty rudimentary, but it got the job done, and more importantly, it was super hackable. I hacked the hell out of it, and at this point **ink/stitch is a viable entry-level machine embroidery design tool**.
## "Quick" Setup On Ubuntu 16.04 (and derivative Linux distributions)
Download the [extension's archive file](https://github.com/lexelby/inkscape-embroidery/archive/master.zip) and unpack the zip archive. Then, on a terminal, run the installation (and update) script from the archive's `bin` directory by first changing into that directory with `cd <path_to_the_archive>/inkscape-embroidery-master/bin` and then entering the command `sh install_ink_embroidery_Ubuntu.sh`. The script will ask for your password to be able to install new software, remove any Inkscape snap packages that may be installed, and to update Inkscape to the current version. Intermittently, it will require you to confirm a step by hitting Enter, or typing in 'y' or 'yes'. Restart Inkscape after the script has executed to see the changes take effect. You can also run the script again when you later want to update the extension (and Inkscape).
Download the [extension's archive file](https://github.com/lexelby/inkstitch/archive/master.zip) and unpack the zip archive. Then, on a terminal, run the installation (and update) script from the archive's `bin` directory by first changing into that directory with `cd <path_to_the_archive>/inkstitch-master/bin` and then entering the command `sh install_ink_embroidery_Ubuntu.sh`. The script will ask for your password to be able to install new software, remove any Inkscape snap packages that may be installed, and to update Inkscape to the current version. Intermittently, it will require you to confirm a step by hitting Enter, or typing in 'y' or 'yes'. Restart Inkscape after the script has executed to see the changes take effect. You can also run the script again when you later want to update the extension (and Inkscape).
To also install the optional conversion program, run `sh install_libembroidery-convert.sh` in the same directory. This script will also ask your password in order to be able to install the necessary dependencies.
@ -24,7 +25,7 @@ Continue reading in the "Usage" section.
## Manual Setup
To use this tool, you're going to need to set it up. It's an inkscape extension written as a Python file. Once you get it working, you'll need to learn how to design vectors in the way that inkscape-embroidery expects, and then you can generate your design files.
To use this tool, you're going to need to set it up. It's an inkscape extension written as a Python file. Once you get it working, you'll need to learn how to design vectors in the way that ink/stitch expects, and then you can generate your design files.
### Inkscape
First, install Inkscape if you don't have it. I highly recommend version 0.92 or greater, which has a really key feature: the Objects panel. This gives you a heirarchical list of objects in your SVG file, listed in their stacking order. This is really important because the stacking order dictates the order that the shapes will be sewn in.
@ -39,7 +40,7 @@ pip install -r requirements.txt
```
### Extension installation
1. Clone the extension source: `git clone https://github.com/lexelby/inkscape-embroidery`
1. Clone the extension source: `git clone https://github.com/lexelby/inkstitch`
2. Install it as directed [here](https://inkscape.org/en/gallery/%3Dextension/)
I prefer to symbolically link into my git clone, which allows me to hack on the code. Changes to the Python code take effect the next time the extension is run. Changes to the extension description files (`*.inx`) take effect the next time Inkscape is restarted
@ -47,11 +48,11 @@ I prefer to symbolically link into my git clone, which allows me to hack on the
### Optional: conversion program
The extension can output machine embroidery design files directly in Melco format. I don't even know what that is, so I don't use it. I prefer to use the **CSV output format** which can be consumed by another awesome open source project: [Embroidermodder2](https://github.com/Embroidermodder/Embroidermodder). In theory, this project was going to be exactly what I wanted. In practice, it never got funded on Kickstarter and it's largely incomplete.
However, it contains a really awesome core library that knows pretty much every machine embroidery format and how to convert between them. I use it to convert the CSV files that inkscape-embroidery outputs into the PES files that my SE400 uses.
However, it contains a really awesome core library that knows pretty much every machine embroidery format and how to convert between them. I use it to convert the CSV files that ink/stitch outputs into the PES files that my SE400 uses.
Grab the source: `git clone https://github.com/Embroidermodder/Embroidermodder`. Build just `libembroidery-convert` using the instructions in "3)" in the [Embroidermodder build docs](https://github.com/Embroidermodder/Embroidermodder/wiki/Compiling-parts-of-the-project). You can then use it like this: `./libembroidery-convert your-file.csv your-file.pes`.
Since the CSV + libembroidery-convert method is the only method I use, it's the one I'll assume from here on. I'm not even sure if the other output formats from inkscape-embroidery still work (or ever worked).
Since the CSV + libembroidery-convert method is the only method I use, it's the one I'll assume from here on. I'm not even sure if the other output formats from ink/stitch still work (or ever worked).
## Usage
### Basic Usage
@ -59,21 +60,21 @@ First things first: I'm going to assume you know a few embroidery terms like "fi
1. Open up Inkscape and create a rectangle.
2. Make sure it has both a stroke and a fill.
3. Convert it to a path using **Path -> Object to Path** (because inkscape-embroidery doesn't understand rectangles, circles, and the like, and ignores them).
3. Convert it to a path using **Path -> Object to Path** (because ink/stitch doesn't understand rectangles, circles, and the like, and ignores them).
4. Run **Extensions -> Embroidery -> Embroider**. Use the default settings.
The rectangle you made will disappear and be replaced with some stripes and zig-zags. inkscape-embroidery has hidden all of your layers and created a new one called Embroidery, in which it has palced a visual representation of the stitch plan it created. It has interpreted your shape as two instructions: Fill and Stroke. Fill is implemented using fill stitching, and Stroke is implemented by running satin stitching along the outline.
The rectangle you made will disappear and be replaced with some stripes and zig-zags. ink/stitch has hidden all of your layers and created a new one called Embroidery, in which it has palced a visual representation of the stitch plan it created. It has interpreted your shape as two instructions: Fill and Stroke. Fill is implemented using fill stitching, and Stroke is implemented by running satin stitching along the outline.
Select the horizontal lines using the "Edit Paths by Nodes" tool. Zoom in a bit and you'll see that the lines are actually made up of lots of points. Each point represents one stitch -- one needle penetration and interlocking of the top thread with the bobbin thread. Notice how the points all line up nicely in diagonals. This will give the fill stitching a nice, orderly visual appearance.
Now look at the zig-zags. These are the satin stitches. Note that the corners look pretty ugly. This is because satin stitches generated from a shape's stroke are pretty rudimentary and aren't implemented intelligently. You can exert much greater control over satin stitching using a Satin Column, described later.
The stitching preview you're looking at just now isn't intended to be permanent. I usually immediately undo it (ctrl-Z) after I've looked at the stitches. The actual work that inkscape-embroidery does is to output a design file.
The stitching preview you're looking at just now isn't intended to be permanent. I usually immediately undo it (ctrl-Z) after I've looked at the stitches. The actual work that ink/stitch does is to output a design file.
### Stitching Out the Design
Where'd the design file go? One of the parameters you were able to specify in the filter settings dialog was the output directory. By default, the directory used is the place where you installed the extension's Python files. I output mine to `~/Documents/embroidery/output`.
inkscape-embroidery will create a file named `something.csv`, where `something` is the name of your svg file (e.g. `something.svg`). If `something.csv` already existed, it will be renamed to `something.csv.1`, and `something.csv.1` will be renamed to `something.csv.2`, etc, up to 5 backup copies. When you've got the design the way you like it, save off a copy of `something.csv`.
ink/stitch will create a file named `something.csv`, where `something` is the name of your svg file (e.g. `something.svg`). If `something.csv` already existed, it will be renamed to `something.csv.1`, and `something.csv.1` will be renamed to `something.csv.2`, etc, up to 5 backup copies. When you've got the design the way you like it, save off a copy of `something.csv`.
Next, convert it to your machine's format using `libembroidery-convert` (as described above). Send it to your machine in whatever way one does that for your machine, and try stitching it out!
@ -81,13 +82,13 @@ Next, convert it to your machine's format using `libembroidery-convert` (as desc
Copy your rectangle and paste it elsewhere on your canvas. Deselect any shapes (**Edit -> Deselect**), re-run the extension, and look at the output. You'll see that both regions have been stitched, and there will be a line connecting them. That's a jump-stitch, where the machine will move a long distance between stitching the sections.
If you're like me, your machine can't automatically cut the thread between stitching sections, so you'll need to minimize jump stitches as much as possible through careful planning of your stitch path. If your machine *can* do thread cuts, congratulations! But you'll need to modify inkscape-embroidery to allow you to specify a thread cut, because there's no way to do that right now.
If you're like me, your machine can't automatically cut the thread between stitching sections, so you'll need to minimize jump stitches as much as possible through careful planning of your stitch path. If your machine *can* do thread cuts, congratulations! But you'll need to modify ink/stitch to allow you to specify a thread cut, because there's no way to do that right now.
However, note that inkscape-embroidery pays attention to the colors you use for objects. If you change colors from one object to the next, inkscape-embroidery will include a color-change instruction using the color you've set for the object. My machine cuts the thread and waits for me to switch to the new thread color.
However, note that ink/stitch pays attention to the colors you use for objects. If you change colors from one object to the next, ink/stitch will include a color-change instruction using the color you've set for the object. My machine cuts the thread and waits for me to switch to the new thread color.
#### Reordering
Use the Objects panel to view the stacking order of the objects in your SVG file. Inkscape-embroidery will stitch them in their stacking order, from lowest to highest. You can reorder them in the normal way in inkscape to affect the stitching order.
Use the Objects panel to view the stacking order of the objects in your SVG file. ink/stitch will stitch them in their stacking order, from lowest to highest. You can reorder them in the normal way in inkscape to affect the stitching order.
You can also use the Reorder extension. Hold shift and select the objects you'd like to reorder, one at a time, in the order you'd like them to end up in (lowest to highest). Run **Embroidery -> Reorder**. This extension will pull all of the selected objects out of wherever they were in the stacking order and insert them in order at the same place as the *first* object you selected. This can save you a ton of time. NOTE: this stopped working in more recent versions of inkscape, which no longer tell the extension what order you selected objects in.
@ -105,7 +106,7 @@ Parameters are stored in your SVG file as additional attributes on the XML objec
I recommend avoiding dependence on the default settings specified in the **Embroider** extension's settings window. In fact, I bypass it entirely by binding a keystroke (ctrl+e) to "Embroider (no preferences)" in Inkscape's settings. This way, I can quickly see the stitch plan just by pressing the keystroke. I also bind a keystroke to **Params** so that I can quickly view and change settings for each object.
### Sidenote on extensions
**Params** is a bit weird, in that the dialog is produced by an entirely separate program (the extension) rather than Inkscape itself. This is due to the way Inkscape structures extensions. I wish inkscape-embroidery could have deeper integration into Inkscape's user interface, but it's currently not possible. This is the price we pay for not having to write an entire vector graphics editor program :)
**Params** is a bit weird, in that the dialog is produced by an entirely separate program (the extension) rather than Inkscape itself. This is due to the way Inkscape structures extensions. I wish ink/stitch could have deeper integration into Inkscape's user interface, but it's currently not possible. This is the price we pay for not having to write an entire vector graphics editor program :)
Another issue is that Inkscape has a memory leak related to extensions. The more times you run an extension, the more memory Inkscape uses and the slower it gets. I periodically save my SVG file, close Inkscape, and restart it to work around this issue. See above re: putting up with this kind of hassle so as not to have a to implement an entire vector graphics editor. Hopefully they'll fix this bug soon.
@ -113,7 +114,7 @@ Another issue is that Inkscape has a memory leak related to extensions. The mor
AutoFill is the default method for generating fill stitching. To use it, create a closed path in Inskcape and add a fill color. This algorithm works for complex shapes with or without holes.
inkscape-embroidery will break the shape up into sections that it can embroider at once using back-and-forth rows of stitches. It then adds straight-stitching between sections until it's filled in the entire design. The staggered pattern of stitches is continued seamlessly between sections, so the end result doesn't appear to have any breaks. When moving from one section to the next, it generates running stitching along the border of the shape.
ink/stitch will break the shape up into sections that it can embroider at once using back-and-forth rows of stitches. It then adds straight-stitching between sections until it's filled in the entire design. The staggered pattern of stitches is continued seamlessly between sections, so the end result doesn't appear to have any breaks. When moving from one section to the next, it generates running stitching along the border of the shape.
#### AutoFill parameters
@ -145,7 +146,7 @@ The **flip** option can help you with routing your stitch path. When you enable
### Running Stitch
Running stitch can be created by setting a dashed stroke on a path. Any kind of dashes will do the job, and the stroke width is irrelevant. inkscape-embroidery will create stitches along the path using the stroke width you specify.
Running stitch can be created by setting a dashed stroke on a path. Any kind of dashes will do the job, and the stroke width is irrelevant. ink/stitch will create stitches along the path using the stroke width you specify.
In order to avoid rounding corners, ash extra stitch will be added at the point of any sharp corners.
@ -197,7 +198,7 @@ This is essentially a lower-density satin stitch sewn to the end of the column a
## Workflow
Here's how I use inkscape-embroidery to design embroidery patterns.
Here's how I use ink/stitch to design embroidery patterns.
### Pixels Per Millimeter

Wyświetl plik

@ -1,20 +1,20 @@
# This file is part of the Inkscape extension 'inkscape-embroidery',
# This file is part of the Inkscape extension 'ink/stitch',
# an extension for machine embroidery design using Inkscape.
# Copyright (C) 2017 Maren Hachmann
# inkscape-embroidery is free software: you can redistribute it and/or modify
# ink/stitch is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
# inkscape-embroidery is distributed in the hope that it will be useful,
# ink/stitch is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with inkscape-embroidery. If not, see <http://www.gnu.org/licenses/>.
# along with ink/stitch. If not, see <http://www.gnu.org/licenses/>.
#!/bin/bash
@ -36,13 +36,13 @@ sudo apt-get update
sudo apt-get install inkscape python-pip unzip python-wxgtk3.0
# download lexelby's embroidery extension
wget https://github.com/lexelby/inkscape-embroidery/archive/master.zip
wget https://github.com/lexelby/inkstitch/archive/master.zip
# unzip files
unzip master.zip -d /tmp
# change into new directory
cd inkscape-embroidery-master
cd inkstitch-master
# upgrade pip
pip install -U pip
@ -58,6 +58,6 @@ cp *.py *.inx $HOME/.config/inkscape/extensions
echo "============================
The Inkscape embroidery extension (https://github.com/lexelby/inkscape-embroidery) and its dependencies have been installed, and your Inkscape version is now up to date.
The Inkscape embroidery extension (https://github.com/lexelby/inkstitch) and its dependencies have been installed, and your Inkscape version is now up to date.
Any previously installed Inkscape snap packages have been removed."

Wyświetl plik

@ -1,20 +1,20 @@
# This file is part of the Inkscape extension 'inkscape-embroidery',
# This file is part of the Inkscape extension 'ink/stitch',
# an extension for machine embroidery design using Inkscape.
# Copyright (C) 2017 Maren Hachmann
# inkscape-embroidery is free software: you can redistribute it and/or modify
# ink/stitch is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
# inkscape-embroidery is distributed in the hope that it will be useful,
# ink/stitch is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with inkscape-embroidery. If not, see <http://www.gnu.org/licenses/>.
# along with ink/stitch. If not, see <http://www.gnu.org/licenses/>.
#!/bin/bash

Wyświetl plik

@ -21,9 +21,9 @@ from embroider_simulate import EmbroiderySimulator
def presets_path():
try:
import appdirs
config_path = appdirs.user_config_dir('inkscape-embroidery')
config_path = appdirs.user_config_dir('inkstitch')
except ImportError:
config_path = os.path.expanduser('~/.inkscape-embroidery')
config_path = os.path.expanduser('~/.inkstitch')
if not os.path.exists(config_path):
os.makedirs(config_path)
@ -60,14 +60,14 @@ def delete_preset(name):
save_presets(presets)
def confirm_dialog(parent, question, caption = 'inkscape-embroidery'):
def confirm_dialog(parent, question, caption = 'ink/stitch'):
dlg = wx.MessageDialog(parent, question, caption, wx.YES_NO | wx.ICON_QUESTION)
result = dlg.ShowModal() == wx.ID_YES
dlg.Destroy()
return result
def info_dialog(parent, message, caption = 'inkscape-embroidery'):
def info_dialog(parent, message, caption = 'ink/stitch'):
dlg = wx.MessageDialog(parent, message, caption, wx.OK | wx.ICON_INFORMATION)
dlg.ShowModal()
dlg.Destroy()