kopia lustrzana https://github.com/inkstitch/inkstitch
fix more patch references
rodzic
b1af926ea6
commit
923ff3cb97
|
@ -18,7 +18,7 @@ def get_stitch_plan():
|
|||
|
||||
metadata = g.extension.get_inkstitch_metadata()
|
||||
collapse_len = metadata['collapse_len_mm']
|
||||
patches = g.extension.elements_to_patches(g.extension.elements)
|
||||
patches = g.extension.elements_to_stitch_groups(g.extension.elements)
|
||||
stitch_plan = stitch_groups_to_stitch_plan(patches, collapse_len=collapse_len)
|
||||
|
||||
return jsonify(stitch_plan)
|
||||
|
|
|
@ -213,7 +213,7 @@ class AutoFill(Fill):
|
|||
else:
|
||||
return None
|
||||
|
||||
def to_patches(self, last_patch):
|
||||
def to_stitch_groups(self, last_patch):
|
||||
stitches = []
|
||||
|
||||
starting_point = self.get_starting_point(last_patch)
|
||||
|
|
|
@ -93,7 +93,7 @@ class Clone(EmbroideryElement):
|
|||
|
||||
return elements
|
||||
|
||||
def to_patches(self, last_patch=None):
|
||||
def to_stitch_groups(self, last_patch=None):
|
||||
patches = []
|
||||
|
||||
source_node = get_clone_source(self.node)
|
||||
|
@ -123,7 +123,7 @@ class Clone(EmbroideryElement):
|
|||
elements = self.clone_to_element(self.node)
|
||||
|
||||
for element in elements:
|
||||
patches.extend(element.to_patches(last_patch))
|
||||
patches.extend(element.to_stitch_groups(last_patch))
|
||||
|
||||
return patches
|
||||
|
||||
|
|
|
@ -301,13 +301,13 @@ class EmbroideryElement(object):
|
|||
def stop_after(self):
|
||||
return self.get_boolean_param('stop_after', False)
|
||||
|
||||
def to_patches(self, last_patch):
|
||||
raise NotImplementedError("%s must implement to_patches()" % self.__class__.__name__)
|
||||
def to_stitch_groups(self, last_patch):
|
||||
raise NotImplementedError("%s must implement to_stitch_groups()" % self.__class__.__name__)
|
||||
|
||||
def embroider(self, last_patch):
|
||||
self.validate()
|
||||
|
||||
patches = self.to_patches(last_patch)
|
||||
patches = self.to_stitch_groups(last_patch)
|
||||
apply_patterns(patches, self.node)
|
||||
|
||||
for patch in patches:
|
||||
|
|
|
@ -23,5 +23,5 @@ class EmptyDObject(EmbroideryElement):
|
|||
label = self.node.get(INKSCAPE_LABEL) or self.node.get("id")
|
||||
yield EmptyD((0, 0), label)
|
||||
|
||||
def to_patches(self, last_patch):
|
||||
def to_stitch_groups(self, last_patch):
|
||||
return []
|
||||
|
|
|
@ -190,7 +190,7 @@ class Fill(EmbroideryElement):
|
|||
else:
|
||||
yield InvalidShapeError((x, y))
|
||||
|
||||
def to_patches(self, last_patch):
|
||||
def to_stitch_groups(self, last_patch):
|
||||
stitch_lists = legacy_fill(self.shape,
|
||||
self.angle,
|
||||
self.row_spacing,
|
||||
|
|
|
@ -29,5 +29,5 @@ class ImageObject(EmbroideryElement):
|
|||
def validation_warnings(self):
|
||||
yield ImageTypeWarning(self.center())
|
||||
|
||||
def to_patches(self, last_patch):
|
||||
def to_stitch_groups(self, last_patch):
|
||||
return []
|
||||
|
|
|
@ -29,5 +29,5 @@ class PatternObject(EmbroideryElement):
|
|||
repr_point = next(inkex.Path(self.parse_path()).end_points)
|
||||
yield PatternWarning(repr_point)
|
||||
|
||||
def to_patches(self, last_patch):
|
||||
def to_stitch_groups(self, last_patch):
|
||||
return []
|
||||
|
|
|
@ -101,7 +101,7 @@ class Polyline(EmbroideryElement):
|
|||
def validation_warnings(self):
|
||||
yield PolylineWarning(self.points[0])
|
||||
|
||||
def to_patches(self, last_patch):
|
||||
def to_stitch_groups(self, last_patch):
|
||||
patch = StitchGroup(color=self.color)
|
||||
|
||||
for stitch in self.stitches:
|
||||
|
|
|
@ -828,7 +828,7 @@ class SatinColumn(EmbroideryElement):
|
|||
points.append(Point(split_point.x, split_point.y))
|
||||
return [points, split_count]
|
||||
|
||||
def to_patches(self, last_patch):
|
||||
def to_stitch_groups(self, last_patch):
|
||||
# Stitch a variable-width satin column, zig-zagging between two paths.
|
||||
|
||||
# The algorithm will draw zigzags between each consecutive pair of
|
||||
|
|
|
@ -193,7 +193,7 @@ class Stroke(EmbroideryElement):
|
|||
|
||||
return StitchGroup(self.color, stitches)
|
||||
|
||||
def to_patches(self, last_patch):
|
||||
def to_stitch_groups(self, last_patch):
|
||||
patches = []
|
||||
|
||||
for path in self.paths:
|
||||
|
|
|
@ -29,5 +29,5 @@ class TextObject(EmbroideryElement):
|
|||
def validation_warnings(self):
|
||||
yield TextTypeWarning(self.pointer())
|
||||
|
||||
def to_patches(self, last_patch):
|
||||
def to_stitch_groups(self, last_patch):
|
||||
return []
|
||||
|
|
|
@ -188,7 +188,7 @@ class InkstitchExtension(inkex.Effect):
|
|||
selected.append(node)
|
||||
return selected
|
||||
|
||||
def elements_to_patches(self, elements):
|
||||
def elements_to_stitch_groups(self, elements):
|
||||
patches = []
|
||||
for element in elements:
|
||||
if patches:
|
||||
|
|
|
@ -52,7 +52,7 @@ class Output(InkstitchExtension):
|
|||
|
||||
self.metadata = self.get_inkstitch_metadata()
|
||||
collapse_len = self.metadata['collapse_len_mm']
|
||||
patches = self.elements_to_patches(self.elements)
|
||||
patches = self.elements_to_stitch_groups(self.elements)
|
||||
stitch_plan = stitch_groups_to_stitch_plan(patches, collapse_len=collapse_len, disable_ties=self.settings.get('laser_mode', False))
|
||||
|
||||
temp_file = tempfile.NamedTemporaryFile(suffix=".%s" % self.file_extension, delete=False)
|
||||
|
|
|
@ -302,7 +302,7 @@ class Print(InkstitchExtension):
|
|||
|
||||
self.metadata = self.get_inkstitch_metadata()
|
||||
collapse_len = self.metadata['collapse_len_mm']
|
||||
patches = self.elements_to_patches(self.elements)
|
||||
patches = self.elements_to_stitch_groups(self.elements)
|
||||
stitch_plan = stitch_groups_to_stitch_plan(patches, collapse_len=collapse_len)
|
||||
palette = ThreadCatalog().match_and_apply_palette(stitch_plan, self.get_inkstitch_metadata()['thread-palette'])
|
||||
|
||||
|
|
|
@ -23,7 +23,7 @@ class StitchPlanPreview(InkstitchExtension):
|
|||
realistic = False
|
||||
self.metadata = self.get_inkstitch_metadata()
|
||||
collapse_len = self.metadata['collapse_len_mm']
|
||||
patches = self.elements_to_patches(self.elements)
|
||||
patches = self.elements_to_stitch_groups(self.elements)
|
||||
stitch_plan = stitch_groups_to_stitch_plan(patches, collapse_len=collapse_len)
|
||||
render_stitch_plan(svg, stitch_plan, realistic)
|
||||
|
||||
|
|
|
@ -43,7 +43,7 @@ class Zip(InkstitchExtension):
|
|||
|
||||
self.metadata = self.get_inkstitch_metadata()
|
||||
collapse_len = self.metadata['collapse_len_mm']
|
||||
patches = self.elements_to_patches(self.elements)
|
||||
patches = self.elements_to_stitch_groups(self.elements)
|
||||
stitch_plan = stitch_groups_to_stitch_plan(patches, collapse_len=collapse_len)
|
||||
|
||||
base_file_name = self.get_base_file_name()
|
||||
|
|
Ładowanie…
Reference in New Issue