From 32baf354d7f99a36f682cb918c6f2de932a53bc6 Mon Sep 17 00:00:00 2001 From: Roy-043 <70520633+Roy-043@users.noreply.github.com> Date: Tue, 15 Jun 2021 17:37:21 +0200 Subject: [PATCH] Draft: Fix offsets.py problem with direction if precision=6 The direction of the offset could be faulty if Draft precision=6. Since we are only interested in the side the pointer is on, working with a high precision does not make sense. --- src/Mod/Draft/draftgeoutils/offsets.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/Mod/Draft/draftgeoutils/offsets.py b/src/Mod/Draft/draftgeoutils/offsets.py index 23fe36c998..f6ae038685 100644 --- a/src/Mod/Draft/draftgeoutils/offsets.py +++ b/src/Mod/Draft/draftgeoutils/offsets.py @@ -295,13 +295,14 @@ def offsetWire(wire, dvec, bind=False, occ=False, # check against dvec provided for the offset direction # would not know if dvec is vector of width (Left/Right Align) # or width/2 (Center Align) - dvec0 = DraftVecUtils.scaleTo(v0, dvec.Length) - if DraftVecUtils.equals(dvec0, dvec): + v0.normalize() + v1 = App.Vector(dvec).normalize() + if v0.isEqual(v1, 0.0001): # "Left Offset" (Left Align or 'left offset' in Centre Align) firstDir = 1 firstAlign = 'Left' alignListC.append('Left') - elif DraftVecUtils.equals(dvec0, dvec.negative()): + elif v0.isEqual(v1.negative(), 0.0001): # "Right Offset" (Right Align or 'right offset' in Centre Align) firstDir = -1 firstAlign = 'Right'