diff options
Diffstat (limited to 'lib/elements/satin_column.py')
| -rw-r--r-- | lib/elements/satin_column.py | 72 |
1 files changed, 36 insertions, 36 deletions
diff --git a/lib/elements/satin_column.py b/lib/elements/satin_column.py index 834509fd..e13e1118 100644 --- a/lib/elements/satin_column.py +++ b/lib/elements/satin_column.py @@ -29,22 +29,23 @@ class SatinColumn(EmbroideryElement): @property @param('zigzag_spacing_mm', - _('Zig-zag spacing (peak-to-peak)'), - tooltip=_('Peak-to-peak distance between zig-zags.'), - unit='mm', - type='float', - default=0.4) + _('Zig-zag spacing (peak-to-peak)'), + tooltip=_('Peak-to-peak distance between zig-zags.'), + unit='mm', + type='float', + default=0.4) def zigzag_spacing(self): # peak-to-peak distance between zigzags return max(self.get_float_param("zigzag_spacing_mm", 0.4), 0.01) @property - @param('pull_compensation_mm', - _('Pull compensation'), - tooltip=_('Satin stitches pull the fabric together, resulting in a column narrower than you draw in Inkscape. This setting expands each pair of needle penetrations outward from the center of the satin column.'), - unit='mm', - type='float', - default=0) + @param( + 'pull_compensation_mm', + _('Pull compensation'), + tooltip=_('Satin stitches pull the fabric together, resulting in a column narrower than you draw in Inkscape. This setting expands each pair of needle penetrations outward from the center of the satin column.'), + unit='mm', + type='float', + default=0) def pull_compensation(self): # In satin stitch, the stitches have a tendency to pull together and # narrow the entire column. We can compensate for this by stitching @@ -65,12 +66,12 @@ class SatinColumn(EmbroideryElement): @property @param('contour_underlay_inset_mm', - _('Contour underlay inset amount'), - tooltip=_('Shrink the outline, to prevent the underlay from showing around the outside of the satin column.'), - unit='mm', - group=_('Contour Underlay'), - type='float', - default=0.4) + _('Contour underlay inset amount'), + tooltip=_('Shrink the outline, to prevent the underlay from showing around the outside of the satin column.'), + unit='mm', + group=_('Contour Underlay'), + type='float', + default=0.4) def contour_underlay_inset(self): # how far inside the edge of the column to stitch the underlay return self.get_float_param("contour_underlay_inset_mm", 0.4) @@ -94,23 +95,23 @@ class SatinColumn(EmbroideryElement): @property @param('zigzag_underlay_spacing_mm', - _('Zig-Zag spacing (peak-to-peak)'), - tooltip=_('Distance between peaks of the zig-zags.'), - unit='mm', - group=_('Zig-zag Underlay'), - type='float', - default=3) + _('Zig-Zag spacing (peak-to-peak)'), + tooltip=_('Distance between peaks of the zig-zags.'), + unit='mm', + group=_('Zig-zag Underlay'), + type='float', + default=3) def zigzag_underlay_spacing(self): return max(self.get_float_param("zigzag_underlay_spacing_mm", 3), 0.01) @property @param('zigzag_underlay_inset_mm', - _('Inset amount'), - tooltip=_('default: half of contour underlay inset'), - unit='mm', - group=_('Zig-zag Underlay'), - type='float', - default="") + _('Inset amount'), + tooltip=_('default: half of contour underlay inset'), + unit='mm', + group=_('Zig-zag Underlay'), + type='float', + default="") def zigzag_underlay_inset(self): # how far in from the edge of the satin the points in the zigzags # should be @@ -147,7 +148,6 @@ class SatinColumn(EmbroideryElement): else: return self.flatten_beziers_with_rungs() - def flatten_beziers_with_rungs(self): input_paths = [self.flatten([path]) for path in self.csp] input_paths = [shgeo.LineString(path[0]) for path in input_paths] @@ -176,16 +176,17 @@ class SatinColumn(EmbroideryElement): #print >> dbg, "rails and rungs", [str(rail) for rail in rails], [str(rung) for rung in rungs] if len(linestrings.geoms) < len(rungs.geoms) + 1: - self.fatal(_("satin column: One or more of the rungs doesn't intersect both rails.") + " " + _("Each rail should intersect both rungs once.")) + self.fatal(_("satin column: One or more of the rungs doesn't intersect both rails.") + + " " + _("Each rail should intersect both rungs once.")) elif len(linestrings.geoms) > len(rungs.geoms) + 1: - self.fatal(_("satin column: One or more of the rungs intersects the rails more than once.") + " " + _("Each rail should intersect both rungs once.")) + self.fatal(_("satin column: One or more of the rungs intersects the rails more than once.") + + " " + _("Each rail should intersect both rungs once.")) paths = [[Point(*coord) for coord in ls.coords] for ls in linestrings.geoms] result.append(paths) return zip(*result) - def simple_flatten_beziers(self): # Given a pair of paths made up of bezier segments, flatten # each individual bezier segment into line segments that approximate @@ -223,8 +224,8 @@ class SatinColumn(EmbroideryElement): if len(self.csp) == 2: if len(self.csp[0]) != len(self.csp[1]): - self.fatal(_("satin column: object %(id)s has two paths with an unequal number of points (%(length1)d and %(length2)d)") % \ - dict(id=node_id, length1=len(self.csp[0]), length2=len(self.csp[1]))) + self.fatal(_("satin column: object %(id)s has two paths with an unequal number of points (%(length1)d and %(length2)d)") % + dict(id=node_id, length1=len(self.csp[0]), length2=len(self.csp[1]))) def offset_points(self, pos1, pos2, offset_px): # Expand or contract two points about their midpoint. This is @@ -443,7 +444,6 @@ class SatinColumn(EmbroideryElement): return patch - def to_patches(self, last_patch): # Stitch a variable-width satin column, zig-zagging between two paths. |
