Skip to content

Commit 27fd4aa

Browse files
committed
add dim check in animate __init__
1 parent cc7398f commit 27fd4aa

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

spatialmath/base/animate.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,8 +105,11 @@ def __init__(
105105
# # ax.set_aspect('equal')
106106
ax = smb.plotvol3(ax=ax, dim=dim)
107107
if dim is not None:
108+
dim = list(np.ndarray.flatten(np.array(dim)))
108109
if len(dim) == 2:
109110
dim = dim * 3
111+
elif len(dim) != 6:
112+
raise ValueError(f"dim must have 2 or 6 elements, got {dim}. See docstring for details.")
110113
ax.set_xlim(dim[0:2])
111114
ax.set_ylim(dim[2:4])
112115
ax.set_zlim(dim[4:])

0 commit comments

Comments
 (0)