EmbroidePy / pyembroidery

pyembroidery library for reading and writing a variety of embroidery formats.
MIT License
181 stars 33 forks source link

First stitch is not written to output #173

Open evanreierson opened 2 months ago

evanreierson commented 2 months ago

It appears that the first stitch in a pattern and the first stitch after a move is not written to the output. I am new to machine embroidery-- is this expected?

For example,

import pyembroidery as pyemb

def stitch_square (pattern):
    #pattern.stitch(0, 0)
    pattern.stitch(0, 10)
    pattern.stitch(10, 0)
    pattern.stitch(0, -10)
    pattern.stitch(-10, 0)

pattern = pyemb.EmbPattern()

stitch_square(pattern)
pattern.move(20, 0)
stitch_square(pattern)
pattern.end()

pyemb.write(pattern, "example.png")

Produces this: image

However, when pattern.stitch(0,0) is un-commented at the beginning of stitch_square, the output is as I expect it: image

I see the same behavior when writing to different outputs (I have tried .exp and .dst) and using a 3rd-party renderer.

Thank you!