From e008a3afe8a7cdab0171f643c4c72a64d3982605 Mon Sep 17 00:00:00 2001 From: Roy-043 <70520633+Roy-043@users.noreply.github.com> Date: Thu, 20 Jul 2023 18:46:10 +0200 Subject: [PATCH] Draft: Auto workingplane ignored rotation around axis (#9955) --- src/Mod/Draft/WorkingPlane.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Mod/Draft/WorkingPlane.py b/src/Mod/Draft/WorkingPlane.py index 397a5f8e40..da0698d7c1 100644 --- a/src/Mod/Draft/WorkingPlane.py +++ b/src/Mod/Draft/WorkingPlane.py @@ -795,11 +795,11 @@ class Plane: coin_up = coin.SbVec3f(0, 1, 0) upvec = Vector(rot.multVec(coin_up).getValue()) vdir = view.getViewDirection() - # The angle is between 0 and 180 degrees. - angle = vdir.getAngle(self.axis) - # don't change the plane if the axis is already - # antiparallel to the current view - if abs(math.pi - angle) > Part.Precision.angular(): + # don't change the plane if the axis and v vector + # are already correct: + tol = Part.Precision.angular() + if abs(math.pi - vdir.getAngle(self.axis)) > tol \ + or abs(math.pi - upvec.getAngle(self.v)) > tol: self.alignToPointAndAxis(Vector(0, 0, 0), vdir.negative(), 0, upvec) except Exception: