Skip to content

Commit

Permalink
PMV Y-axis flipped.
Browse files Browse the repository at this point in the history
The loading and writing routines need to be y-flipped to work correctly. See EmbroidePy/MaKe-stitch#2
  • Loading branch information
tatarize authored Nov 11, 2020
1 parent a5221f3 commit a0f69fc
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pyembroidery/PmvReader.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def read_pmv_stitches(f, out, settings=None):
if x > 32:
x = -(64 - x) # This is a 6 bit signed number.
x *= 2.5
y *= 2.5
y *= -2.5
dx = x
out.stitch_abs(px + x, y) # This is a hybrid relative, absolute value.
px += dx
Expand Down
4 changes: 2 additions & 2 deletions pyembroidery/PmvWriter.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def write(pattern, f, settings=None):
for stitch in pattern.stitches:
data = stitch[2]
x = stitch[0]
y = stitch[1]
y = -stitch[1]
if data == STITCH or data == JUMP:
point_count += 1
if x > max_x:
Expand Down Expand Up @@ -57,7 +57,7 @@ def write(pattern, f, settings=None):
break
data = stitch[2] & COMMAND_MASK
x = stitch[0]
y = stitch[1]
y = -stitch[1]
x *= scale_x
y -= center_y
y *= scale_y
Expand Down

0 comments on commit a0f69fc

Please sign in to comment.