Repository navigation
Apply in-plane scaling and mirroring in MLine.transform() - #1463
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #1457.
MLine.transform()only updatedscale_factorwhen all three components of the transformed(s, s, s)vector were equal. So a uniform 2D scale (sz = 1, the usual scaled block reference) or a rotation with a scale kept the oldscale_factor, and a mirror put the line elements of a one-sided style on the wrong side.It now uses
OCSTransformlike CIRCLE and ARC: the extrusion is perpendicular to the transformed OCS x- and y-axis (so a mirror flips it), and the scale factor is multiplied by the in-plane scale when that scale is uniform. Non-uniform scaling is still ignored, as before.The new test compares the transformed MLINE with its untransformed LINEs transformed one by one: 2D scale, rotation + scale, mirror x, mirror z and rotation + mirror + x100. 7 of the 10 cases from the issue were wrong on master, all match now.
pytest testspasses and mypy is clean for the file.Used Claude (Opus) to help find and patch this; I reviewed and tested the change