Move mobject positioning methods into separate class - #4994
Open
GniLudio wants to merge 4 commits into
Open
Conversation
Comment on lines
+367
to
+374
| def scale( | ||
| self, | ||
| # TODO: Rename to `factor` | ||
| scale_factor: float, | ||
| *, | ||
| about_point: Point3DLike | None = None, | ||
| about_edge: Vector3DLike | None = None, | ||
| ) -> Self: |
Comment on lines
+1590
to
+1591
| # if self.has_no_points() and not mobject.submobjects: | ||
| # raise Warning("Attempting to replace mobject with no points") |
Comment on lines
+1600
to
+1608
| def surround( | ||
| self, | ||
| mobject: Positionable, | ||
| # TODO: Rename to `dim` | ||
| dim_to_match: int = 0, | ||
| stretch: bool = False, | ||
| *, | ||
| buff: float = MED_SMALL_BUFF, | ||
| ) -> Self: |
Contributor
Author
|
The docs include the new class now: Positionable.html |
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.
Overview: What does this pull request change?
Moves the
Mobjectpositioning methods into their own class.Motivation and Explanation: Why and how do your changes improve the library?
Changes
get_all_pointsand someget_points_defining_boundarycoor_maskparameter frommove_toStructure
Here is the full structure
Benchmark
I used randomized testing with 10-100k points (without submobjects) to benchmark and validate the changes.
Here are the benchmark results
To run the tests yourself, switch to the main branch and execute the following commands.
Future
Here are a few things that aren't addressed with this PR, but should definitely be discussed and/or changed in the future.
Positionablefor openglLinks to added or changed documentation pages
Positionable.html, Mobject.html
Reviewer Checklist