-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Add orientation to VMobject, shoelace, ArcPolygon, Tiling, Graph #210
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
Conversation
Added shoelace method to space_ops.py Added orientation methods to vectorized_mobject.py, uses shoelace Added ArcPolygon, Tiling and Graph to geometry.py
Could you write a test of this PR ? Refer to the wiki to see the instructions. And just a request, could you add a visual of your changes ? like an image, or a gif. It would be easier for all of us to see and understand what you did. Thank you in advance ! |
Sure I guess, but I'll have to work myself into the testing architecture. From the looks of it... I have to mostly add scenes to |
Yes, in theory you only have to touch |
But I'd wager tests should also test some consistency on applying colors etc... but I see nothing like this in the tests, nor in the wiki. Do we have any policy on that? |
Alright. BraceBetweenPoints has been added, tests for the 3 new geometry classes have been added, and the OP now contains gifs of the orientation methods and the 3 new geometry classes. |
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.
I think I'm speaking for @PgBiel here, but I think that it would be extremely useful if you could add numpy
style docstrings to the objects and methods that you have added.
Having the detailed breakdown of instantiating each object (like you've done now) is really well done and detailed, but having docstrings for each and every method would be extremely useful when using an IDE.
Noted. I'll have a look at that. Shouldn't be too hard to add considering it's not that many new objects/methods. And there's not really such a thing as too verbose comments. |
Alright I've added yet more verbose docstrings, fixed a few formatting issues I made myself and also added Honeycomb, which basically just Tiling in 3D. There's some beef with the new formatting though, it's not giving me logs, and the local black installation was unwilling to check the files I tried to use it on, instead opting to complain about being unable to import stuff, so if there's something specific you need on the formatting someone else is gonna have to tell me what and how. |
I've been thinking about this but neither of these seem like great ideas either. I'll probably think about this some more since this isn't gonna get merged today anyway. Edit: Maybe something like: |
EdgeVertex Graph looks good to me. Pinging Captain Docs @PgBiel to check the docstrings (if he has time, of course) |
@XorUnison I ran your branch through black and there were about 10 files that needed reformatting, these were reformatted and that's what my commit is.
|
EdgeVertexGraph seems a bit clunky, but it's definitely much clearer than Graph while being less clunky than GraphTheoryGraph. I adjusted it.
Noted and appreciated, but a bunch of those files weren't even touched by me. Probably jankyness from the switch. Although I also figured out along with this commit that Black ignores the very first standard outlined in PEP8 and pretends it doesn't exist, opening delimiter alignment, which also made Black instantly die as a serious PEP8 autoformatter in my eyes. Thanks to that it made some changes that are technically still okay within PEP8, but positively hideous ones that aren't really in alignment with the underlying intent of PEP8 either. I mean ignoring the very first standard of PEP8...? |
What's the status of this PR? Can we get an update please? :) I believe I saw some discussion about this on Discord. |
Still working through all the requested changes. The only one that's currently left is a suggestion by EulerTour on how to handle the functions applied to the tiles. His suggestion is a bit more complicated for the simplest scenarios, but it is more flexible and pythonic in total, and also deals better with more complicated scenarios. So I aim to digest it and switch up the way Tiling works again, since it's supposed to be as good as possible upon merging after all. Once that's done I have to fix all the conflicts piling up and then it'll be ready for review again. |
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.
see the docs guidelines in the wiki for more info
|
||
Parameters | ||
---------- | ||
*arcs : Arc or ArcBetweenPoints |
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.
doc fixes
*arcs : Arc or ArcBetweenPoints | |
arcs : Union[:class:`Arc`, :class:`ArcBetweenPoints`] |
|
||
Example | ||
------- | ||
ArcPolygon(arc0,arc1,arc2,arcN,**kwargs) |
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.
so that sphinx displays it properly
ArcPolygon(arc0,arc1,arc2,arcN,**kwargs) | |
:: | |
ArcPolygon(arc0,arc1,arc2,arcN,**kwargs) |
manim/mobject/geometry.py
Outdated
ArcPolygon also doubles as a group for the input arcs. | ||
That means these arcs can be drawn and seen separately. | ||
If only the ArcPolygon itself is supposed to be visible, | ||
make the arcs invisible (for example with "stroke_width": 0). | ||
ArcPolygon.arcs can be used get values from these subarcs. |
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 shouldn't be under Examples but in description itself
manim/mobject/geometry.py
Outdated
class ArcPolygon(VMobject): | ||
""" | ||
The ArcPolygon is what it says, a polygon, but made from arcs. | ||
More versatile than the standard Polygon. |
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.
just so it links to the class for quick access
More versatile than the standard Polygon. | |
More versatile than the standard :class:`Polygon`. |
""" | ||
This method computes and applies the offsets for the tiles, | ||
in the given dimension. | ||
multiplies inputs, which requires arrays to be numpy arrays. |
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.
docs of parameters
manim/mobject/geometry.py
Outdated
The tile prototype can be any Mobject (also groups) or a function. | ||
The function format is function(x,y), returning a Mobject. | ||
Using groups or functions allows the tiling to contain multiple | ||
different tiles or to simplify the following offset functions. |
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.
should be moved to tile_prototype short desc
manim/mobject/geometry.py
Outdated
Next are two nested lists that determine how the tiles are arranged. | ||
The functions are typically Mobject.shift and Mobject.rotate. | ||
Each list has to contain sublists with Function/Value pairs. | ||
More on this in the Examples section. |
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.
should be moved to the offset short descs
manim/mobject/geometry.py
Outdated
Last are two ranges: If both ranges are range(-1,1,1), | ||
that would result in a square grid of 9 tiles. |
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.
should be moved to range short descs
Co-authored-by: Pg Biel <9021226+PgBiel@users.noreply.github.com>
Co-authored-by: Pg Biel <9021226+PgBiel@users.noreply.github.com>
The final edits before the changes in here are spread into multiple new and fresh PRs
…/manim into GeometryAdditions
Hi @XorUnison do you have any updates on this branch? :) |
There hasn't been any movement here for over two months, and by now it will be highly non-trivial to deal with the merge conflicts here. I vote we close this :( |
Committing suggestions to use in new branch Co-authored-by: Pg Biel <9021226+PgBiel@users.noreply.github.com>
Committing suggestions to use in new branch Co-authored-by: Pg Biel <9021226+PgBiel@users.noreply.github.com>
Committing suggestions to use in new branch Co-authored-by: Pg Biel <9021226+PgBiel@users.noreply.github.com>
Added shoelace method to space_ops.pyAdded orientation methods to vectorized_mobject.py, uses shoelaceAdded
ArcPolygon, Tiling andGraphto geometry.pyAdded Honeycomb to three_dimensions.py
Added BraceBetweenPoints to brace.pyThe code I used for testing the new additions:
Pretty self-explanatory.