Patterns and stitch types#
- class turtlethread.stitches.EmbroideryPattern(scale: int = 1)[kilde]#
Abstract representation of an embroidery pattern.
Container object
- Parameters:
- scale: int (optional, default=1)
All coordinates are multiplied by this parameter before converting it to a PyEmbroidery pattern. This is useful to control the number of steps per mm (default is 10 steps per mm).
- get_stitch_command() list[tuple[float, float, Literal[0, 1, 2]]] [kilde]#
Get stitch commands for PyEmbroidery.
This function is used when embroidery patterns contain whole embroidery patterns. If you’re not explicitly making patterns within patterns, then you probably want to use the
to_pyembroidery()
method instead.
- class turtlethread.stitches.StitchGroup(start_pos: Vec2D)[kilde]#
Object representing one contiguous set of commands for the embroidery machine.
Stitch groups are used to convert the Turtle commands into embroidery machine commands. For example, if you want to embroider with a running stitch, then you’d create a stitch group for a running stitch with the corresponding stitch length.
Stitch groups work by storing subsequent locations of the Turtle and converts them into embroidery commands.
- Parameters:
- start_pos: Vec2D (tuple[float, float])
The initial position of the turtle.
- class turtlethread.stitches.RunningStitch(start_pos: Vec2D, stitch_length: int | float)[kilde]#
Stitch group for running stitches.
With a running stitch, we get stitches with a constant distance between each stitch.
If the turtle is supposed to move a number of steps that is not a multiple of
stitch_length
, then all but the last stitch in that stretch will have the same length and the last stitch will be between0.5*stitch_length
and1.5*stitch_length
.- Parameters:
- stitch_lengthint
Number of steps between each stitch.
- empty_copy(start_pos) Self #
Create a copy of the stitch group but with no stored locations (i.e. no stitches).
- class turtlethread.stitches.JumpStitch(start_pos: Vec2D, skip_intermediate_jumps: bool = True)[kilde]#
Stitch group for jump stitches.
A jump stitch group always starts with a trim command followed by the needle moving without sewing any stitches.
See
StitchGroup
for more information on stitch groups.- Parameters:
- skip_intermediate_jumpsbool (optional, default=True)
If True, then multiple jump commands will be collapsed into one jump command. This is useful in the cases where there may be multiple subsequent jumps with no stitches inbetween. Multiple subsequent jumps doesn’t make sense but it can happen dependent on how you generate your patterns.
- empty_copy(start_pos) Self #
Create a copy of the stitch group but with no stored locations (i.e. no stitches).