Skip to content

Commit

Permalink
Add a failsafe to VisCurve3D if the input is 2D
Browse files Browse the repository at this point in the history
  • Loading branch information
Onur R. Bingol committed Feb 13, 2018
1 parent 057299e commit cc93f63
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions geomdl/visualization/VisMPL.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,12 @@ def render(self):
# Start plotting
for plot in self._plots:
pts = np.array(plot['ptsarr'])

# Try not to fail if the input is 2D
if pts.shape[1] == 2:
pts = np.c_[pts, np.zeros(pts.shape[0])]

# Control points or not
if plot['type'] == 1:
if self._plot_ctrlpts:
ax.plot(pts[:, 0], pts[:, 1], pts[:, 2], color=plot['color'], linestyle='-.', marker='o')
Expand Down

0 comments on commit cc93f63

Please sign in to comment.