From 825e0cac5e975273a4b3775b1df393a6eb82b51c Mon Sep 17 00:00:00 2001 From: Joe Marshall Date: Thu, 11 Jan 2024 14:20:43 +0000 Subject: [PATCH] fix for mac? --- scripts/addons/cam/gcodepath.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/scripts/addons/cam/gcodepath.py b/scripts/addons/cam/gcodepath.py index 09cb4564..19d9693c 100644 --- a/scripts/addons/cam/gcodepath.py +++ b/scripts/addons/cam/gcodepath.py @@ -313,6 +313,9 @@ def exportGcodePath(filename, vertslist, operations): scale_graph = 0.05 # warning this has to be same as in export in utils!!!! + + ZERO_DIFFERENCE = 0.0000000001 # difference (in units) that is counted as zero + ii = 0 offline = 0 online = 0 @@ -355,26 +358,26 @@ def exportGcodePath(filename, vertslist, operations): rcompensate.z = -r.z v.rotate(rcompensate) - if r.x == lastrot.x: + if abs(r.x - lastrot.x) <= ZERO_DIFFERENCE: ra = None else: ra = r.x * rotcorr - if r.y == lastrot.y: + if abs(r.y - lastrot.y) <= ZERO_DIFFERENCE: rb = None else: rb = r.y * rotcorr - if vi > 0 and v.x == last.x: + if vi > 0 and abs(v.x - last.x) <= ZERO_DIFFERENCE: vx = None else: vx = v.x * unitcorr - if vi > 0 and v.y == last.y: + if vi > 0 and abs( v.y - last.y) <= ZERO_DIFFERENCE: vy = None else: vy = v.y * unitcorr - if vi > 0 and v.z == last.z: + if vi > 0 and abs(v.z - last.z) <= ZERO_DIFFERENCE: vz = None else: vz = v.z * unitcorr