Skip to content

Conversation

Meghs21
Copy link

@Meghs21 Meghs21 commented Oct 18, 2025

This PR addresses the confusing behavior of the Axes.c2p() function when passing 1D lists or arrays as input coordinates.

Changes made:

Fix for c2p() behavior:

Properly handles single points provided as lists or 1D numpy arrays.

Returns a single point as np.array of shape (3,) and multiple points as np.array of shape (3, n_points).

Maintains compatibility with existing multi-argument input (x, y, z) and 2D list/array inputs.

Added tests:

Tests that reproduce the previously confusing outputs for 1D lists and arrays.

Confirms that single points, multi-points, and lists of points all produce expected outputs.
C2PBehavior_ManimCE_v0 19 0

Motivation:
This clarifies the expected input/output behavior of c2p(), reduces confusion for users, and ensures consistency across different input types.

Notes:

No changes to existing functionality beyond the improved handling of 1D inputs.

Thanks to @uwezi for highlighting the issue in #4073
.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: 🆕 New

Development

Successfully merging this pull request may close these issues.

1 participant