Skip to content

Commit 2bd89d3

Browse files
author
Onur Rauf Bingol
committed
Improve compatibility of VisPlotly.VisCurve3D
1 parent fa9ccbb commit 2bd89d3

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

geomdl/visualization/VisPlotly.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,10 @@ def render(self, **kwargs):
200200
for plot in self._plots:
201201
pts = np.array(plot['ptsarr'], dtype=self.vconf.dtype)
202202

203+
# Try not to fail if the input is 2D
204+
if pts.shape[1] == 2:
205+
pts = np.c_[pts, np.zeros(pts.shape[0])]
206+
203207
# Plot control points
204208
if plot['type'] == 'ctrlpts' and self.vconf.display_ctrlpts:
205209
figure = graph_objs.Scatter3d(

0 commit comments

Comments
 (0)