Draft: Auto workingplane ignored rotation around axis (#9955)

This commit is contained in:
Roy-043
2023-07-20 18:46:10 +02:00
committed by GitHub
parent 9e18bd2d00
commit 1d7e2c3de0

View File

@@ -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: