diff options
| author | Lex Neva <lexelby@users.noreply.github.com> | 2018-01-23 20:13:37 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-01-23 20:13:37 -0500 |
| commit | acaebaa956006a0fa064c2361b47f902a8a50b77 (patch) | |
| tree | e4278dd088d82bbc9830b9281accc9d813bd8dd8 /embroider_simulate.py | |
| parent | 462bf0bdbeed8b4a631d2ce6d68df7842a86e5c6 (diff) | |
add params for "TRIM after" and "STOP after" (#29)
* adds new options to Params: "TRIM after" and "STOP after"
* adds tooltip support to Params
* inkstitch now includes libembroidery and can directly output any supported file type
* this avoids the need for `libembroidery-convert` and compiling embroidermodder!
* TRIM support for DST format (inserts 3 JUMPs)
* STOP command supported as an extra color change that the operator can assign to code C00
* TRIMs cause the following jump stitch not to be displayed in the Embroidery layer
Diffstat (limited to 'embroider_simulate.py')
| -rw-r--r-- | embroider_simulate.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/embroider_simulate.py b/embroider_simulate.py index f10f39f0..4b772692 100644 --- a/embroider_simulate.py +++ b/embroider_simulate.py @@ -149,6 +149,7 @@ class EmbroiderySimulator(wx.Frame): return segments def _parse_stitch_file(self, stitch_file_path): + # "#", "comment" # "$","1","229","229","229","(null)","(null)" # "*","JUMP","1.595898","48.731899" # "*","STITCH","1.595898","48.731899" @@ -161,6 +162,10 @@ class EmbroiderySimulator(wx.Frame): with open(stitch_file_path) as stitch_file: for line in stitch_file: + line = line.strip() + if not line: + continue + fields = line.strip().split(",") fields = [self._strip_quotes(field) for field in fields] @@ -180,6 +185,10 @@ class EmbroiderySimulator(wx.Frame): x, y = fields[2:] new_pos = (float(x) * PIXELS_PER_MM, float(y) * PIXELS_PER_MM) + if not segments and new_pos == (0.0, 0.0): + # libembroidery likes to throw an extra JUMP in at the start + continue + if not cut: segments.append(((pos, new_pos), pen)) |
