Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit ed05556

Browse files
committed
Add a shape assert
1 parent 8bc8d62 commit ed05556

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

lib/mpl_toolkits/mplot3d/art3d.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -577,7 +577,10 @@ def set_zsort(self, zsort):
577577

578578
def get_vector(self, segments3d):
579579
"""Optimize points for projection."""
580+
# segments3d.shape == (num_faces, num_vertices, 3)
580581
if isinstance(segments3d, np.ndarray):
582+
assert segments3d.dim == 3 and segments3d.shape[-1] == 3, \
583+
"Incorrect shape of vertices of Poly3DCollection"
581584
self._segments = segments3d
582585
else:
583586
num_faces = len(segments3d)

0 commit comments

Comments
 (0)