Skip to content

Fixing the get_nth_subpath function in "opengl_vectorized_mobject.py". #3790

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

Merged
merged 3 commits into from
Jun 10, 2024

Conversation

yang-tsao
Copy link
Contributor

The insert_n_curves_to_point_list function requires the points argument to be a numpy array, since it calls the get_bezier_tuples_from_points function, which requires points to be a numpy array because it has the return points.reshape((-1, nppc, 3)) statement. Ordinary lists do not have a reshape method.

So we need to convert sp1 and sp2 to numpy arrays before calling the insert_n_curves_to_point_list function.

Motivation and Explanation: Why and how do your changes improve the library?

I fixed the get_nth_subpath function, so it will work with the opengl renderer.

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

yang-tsao and others added 3 commits May 29, 2024 20:54
The "insert_n_curves_to_point_list" function requires the "points" argument to be a numpy array, since it calls the "get_bezier_tuples_from_points" function, which requires "points" to be a numpy array because it has the "return points.reshape((-1, nppc, 3))" statement. Ordinary lists do not have a "reshape" method.

So we need to convert "sp1" and "sp2" to numpy arrays before calling the "insert_n_curves_to_point_list" function.
Update opengl_vectorized_mobject.py
Copy link
Contributor

@chopan050 chopan050 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks for your contribution!

@JasonGrace2282 JasonGrace2282 merged commit c2fa4f9 into ManimCommunity:main Jun 10, 2024
18 checks passed
@chopan050
Copy link
Contributor

Closes #3038

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants