Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add ties checkbox #619

Merged
merged 3 commits into from
Mar 19, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 17 additions & 2 deletions lib/elements/element.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
from copy import deepcopy
import sys
from copy import deepcopy

from cspsubdiv import cspsubdiv
import cubicsuperpath
import simplestyle
from cspsubdiv import cspsubdiv

from ..commands import find_commands
from ..i18n import _
Expand Down Expand Up @@ -168,6 +168,17 @@ def stroke_width(self):
width = convert_length(width)
return width * self.stroke_scale

@property
@param('ties',
_('Ties'),
tooltip=_('Add ties. Manual stitch will not add ties.'),
type='boolean',
default=True,
sort_index=4)
@cache
def ties(self):
return self.get_boolean_param("ties", True)

@property
def path(self):
# A CSP is a "cubic superpath".
Expand Down Expand Up @@ -269,6 +280,10 @@ def embroider(self, last_patch):

patches = self.to_patches(last_patch)

if not self.ties:
for patch in patches:
patch.stitch_as_is = True

if patches:
patches[-1].trim_after = self.has_command("trim") or self.trim_after
patches[-1].stop_after = self.has_command("stop") or self.stop_after
Expand Down