New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Return pure rotation from getPlaneRotation() #8698
Conversation
That seems good and indeed the correct way to handle it as if u and v are given, there is only one direction where w can be. |
self.u.y, self.v.y, self.axis.y, self.position.y, | ||
self.u.z, self.v.z, self.axis.z, self.position.z, | ||
0.0, 0.0, 0.0, 1.0) | ||
m = DraftVecUtils.getPlaneRotation(self.u, self.v) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This function is a bit strange now. The rotated
argument is effectively ignored: if
and else
return the same result.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, it should have been
if rotated:
m = DraftVecUtils.getPlaneRotation(self.u, self.axis)
else rotated:
m = DraftVecUtils.getPlaneRotation(self.u, self.v)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed in PR #9160
fix for mistake in pr #8698 see comment https://github.com/FreeCAD/FreeCAD/pull/8698/files/649857b58f7b100242a2e948e07e11ff2fe64f67#r1155160709
This will fix #8697. By normalizing vector u and make v and w perpendicularand normalized the returned matrix turns into a pure rotation without scales and shears. Using v vector to define xy plane. Leaves the third argument unused but keep it for backward compatibility.