orbingol / NURBS-Python

Object-oriented pure Python B-Spline and NURBS library
https://onurraufbingol.com/NURBS-Python/
MIT License
603 stars 153 forks source link

The extras can't work in Bspline #147

Open Im-fengyin opened 2 years ago

Im-fengyin commented 2 years ago

Describe the bug Load a bspline json file and set a set of points on it, render it using extras param. Only the spline surface is ploted.

To Reproduce surf = exchange.import_json(spline_path)[0] plotlines = [] m,n, = toolPath.shape eval_uv = toolPath.reshape(-1,2) toolPts = surf.evaluate_list(eval_uv.tolist()) toolPts = np.array(toolPts).reshape(m,n,3) for x in range(m): pts = toolPts[x,:,:].tolist() line = dict(color='red',name='u-line',size=10,points=pts) plot_lines.append(line) for y in range(n): pts = toolPts[:,y,:].tolist() line = dict(color='blue',name='v-line',size=10,points=pts) plot_lines.append(line) surf.delta = 0.01 surf.evaluate()

Plot the control point grid and the evaluated surface

vis_comp = vis.VisSurface() surf.vis = vis_comp surf.render(extras=plot_lines)

toolPath is numpy array with size m,n,2 I have check the pts value correctly. But I can't see the lines in rander window.

Configuration: win10,python3.8