Skip to content
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

Merged
merged 1 commit into from Feb 28, 2023

Conversation

Jolbas
Copy link
Contributor

@Jolbas Jolbas commented Feb 28, 2023

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.

@github-actions github-actions bot added the WB Draft Related to the Draft Workbench label Feb 28, 2023
@freecadci
Copy link

pipeline status for feature branch PR_8698. Pipeline 790833560 was triggered at 649857b. All CI branches and pipelines.

@yorikvanhavre
Copy link
Member

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.

@yorikvanhavre yorikvanhavre merged commit 8f36e48 into FreeCAD:master Feb 28, 2023
@Jolbas Jolbas deleted the draftvecutil branch February 28, 2023 09:01
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)
Copy link
Contributor

@Roy-043 Roy-043 Apr 1, 2023

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.

Copy link
Contributor Author

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)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed in PR #9160

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
WB Draft Related to the Draft Workbench
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Issue] DraftVecUtils.getPlaneRotation() returns scewed/scaled matrix
4 participants