summaryrefslogtreecommitdiff
path: root/lib/elements
diff options
context:
space:
mode:
authorLex Neva <github.com@lexneva.name>2023-03-10 22:15:40 -0500
committerLex Neva <github.com@lexneva.name>2023-03-10 22:15:40 -0500
commit1b0245c52c8a1a9cb47398d359cc8c9ac0618dad (patch)
tree8811a361979f5855b6dfe6f5aff6df590d6fc080 /lib/elements
parentb58d4b62712518b18354c996d7819f51349141fd (diff)
add reverse one rail param
Diffstat (limited to 'lib/elements')
-rw-r--r--lib/elements/satin_column.py21
1 files changed, 19 insertions, 2 deletions
diff --git a/lib/elements/satin_column.py b/lib/elements/satin_column.py
index 8c39b4d2..1d856e10 100644
--- a/lib/elements/satin_column.py
+++ b/lib/elements/satin_column.py
@@ -212,12 +212,24 @@ class SatinColumn(EmbroideryElement):
@property
@param(
+ 'reverse_one_rail',
+ _('Reverse one rail'),
+ tooltip=_('Enabling this may help if your satin renders very strangely.'),
+ type='boolean',
+ default='false',
+ sort_index=10)
+ def reverse_one_rail(self):
+ return self.get_boolean_param('reverse_one_rail', False)
+
+ @property
+ @param(
'swap_satin_rails',
_('Swap rails'),
tooltip=_('Swaps the first and second rails of the satin column, '
'affecting which side the thread finished on as well as any sided properties'),
type='boolean',
- default='false')
+ default='false',
+ sort_index=11)
def swap_rails(self):
return self.get_boolean_param('swap_satin_rails', False)
@@ -381,7 +393,12 @@ class SatinColumn(EmbroideryElement):
@cache
def flattened_rails(self):
"""The rails, as LineStrings."""
- return tuple(shgeo.LineString(self.flatten_subpath(rail)) for rail in self.rails)
+ paths = [shgeo.LineString(self.flatten_subpath(rail)) for rail in self.rails]
+
+ if paths and self.reverse_one_rail:
+ paths[0] = shgeo.LineString(paths[0].coords[::-1])
+
+ return tuple(paths)
@property
@cache