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
Set corners of :class:~.Rectangle
in counterclockwise direction
#1249
Set corners of :class:~.Rectangle
in counterclockwise direction
#1249
Conversation
My bad, I ran |
Really nice stuff you can see why tests are failing with --show_diff flag, but I think it's fine to re-generate the graphical unit data for this test |
Rectangle
in counterclockwise direction~.Rectangle
in counterclockwise direction
I think the failing macos test can be fixed once #1255 is merged? |
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.
LGTM, yes tests should pass after #1255
tests still fail on macox -_- |
That's because the branch hasn't updated to include the changes from #1255; @abhi3019, please update when you can. |
Done @jsonvillanueva |
Something weird is happening here. I don't have the button for merging the latest master in the GH UI, and I also can't push to the branch. I'll merge it nonetheless now (thanks for your contribution!), and we can revert it in case it causes problems. |
@behackl |
That would be a good explanation. |
Changelog / Overview
This improves the look of transformations between rectangles and other simple mobjects.
Motivation
Here's how the
Transform
ation fromSquare
toCircle
looks currentlyTest.mp4
Notice how the
Square
gets flipped during theTransform
.Explanation for Changes
This is because the corners of
Rectangle
s are set in clockwise directionmanim/manim/mobject/geometry.py
Line 1823 in 9c96d16
Arc
s thepoints
are set in counterclockwise directionmanim/manim/mobject/geometry.py
Lines 288 to 295 in 9c96d16
This is what causes the
Square
to be flipped during theTransform
. This PR changes the cw-orientation ofRectangle
's corners(UL, UR, DR, DL)
to ccw-orientation(UR, UL, DL, DR)
Testing Status
Transform
ation looks nowTest.mp4
Further Comments
This PR is inspired from Kolibril13's idea to enhance transformation. I've looked into the entire
geometry.py
module to check if any otherMobject
needs this switch in orientation. Turned out it's just theRectangle
. Let me know if I missed something.Checklist
Reviewer Checklist