From a0f69fc52de382f687ba9a9d2c9125349278ce4c Mon Sep 17 00:00:00 2001 From: tatarize Date: Wed, 11 Nov 2020 04:47:41 -0800 Subject: [PATCH] PMV Y-axis flipped. The loading and writing routines need to be y-flipped to work correctly. See EmbroidePy/MaKe-stitch#2 --- pyembroidery/PmvReader.py | 2 +- pyembroidery/PmvWriter.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pyembroidery/PmvReader.py b/pyembroidery/PmvReader.py index e4e467ef..e78ab31c 100644 --- a/pyembroidery/PmvReader.py +++ b/pyembroidery/PmvReader.py @@ -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 diff --git a/pyembroidery/PmvWriter.py b/pyembroidery/PmvWriter.py index c159ea8f..91fe93eb 100644 --- a/pyembroidery/PmvWriter.py +++ b/pyembroidery/PmvWriter.py @@ -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: @@ -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