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

Fix return type of Polygram.get_vertex_groups() and rename variables in .round_corners() #4063

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

chopan050
Copy link
Contributor

@chopan050 chopan050 commented Dec 17, 2024

Polygram.get_vertex_groups() returns a sequence of point arrays representing the vertex groups of Polygram. Currently, it tries to return a single 3D NumPy array, but that assumes that all the vertex groups have the same length, which does not always happen. When it doesn't happen, this function crashes.

Instead, this PR modifies this method to return a list[Point3D_Array]: a list of 2D NumPy arrays.

Plus, this PR renames variables in Polygram.round_corners():

  • vertices -> vertex_group
  • currentRadius -> current_radius
  • nonZeroLengthArcs -> nonzero_length_arcs
  • totalCurveCount -> num_curves
  • averageLengthPerCurve -> average_arc_length

Links to added or changed documentation pages

https://manimce--4063.org.readthedocs.build/en/4063/reference/manim.mobject.geometry.polygram.Polygram.html#manim.mobject.geometry.polygram.Polygram.get_vertex_groups

Reviewer Checklist

  • The PR title is descriptive enough for the changelog, and the PR is labeled correctly
  • If applicable: newly added non-private functions and classes have a docstring including a short summary and a PARAMETERS section
  • If applicable: newly added functions and classes are tested

@chopan050 chopan050 added the pr:easy review There is nothing particular (i.e, it's about a general/small thing) to know for review! label Dec 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr:easy review There is nothing particular (i.e, it's about a general/small thing) to know for review!
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant