I'm trying to work with NURBS using geomdl. I already have an matplotib axis, where several elements are plotted using:
- plot()
- scatter()
- imshow() (for Background image)
- add_patch
The result looks like this: https://i.stack.imgur.com/vNMYj.png
Now I want to plot a NURBS curve with geomdl.
This code
from geomdl import BSpline
from geomdl.visualization import VisMPL
crv = BSpline.Curve()
crv.degree = 2
crv.ctrlpts = [[1, 0, 0], [1, 1, 0], [0, 1, 0]]
crv.knotvector = [0, 0, 0, 1, 1, 1]
vis_config = VisMPL.VisConfig(legend=False, axes=False, figure_dpi=120, ctrlpts=False, evalpts=True)
vis_obj = VisMPL.VisCurve2D(vis_config)
crv.vis = vis_obj
crv.render()
lets me display a NURBS curve. But it appears in a separate window. How can I plot in the existing axis/figure as shown in my screenshot?
I was blind. The solution is easy, I think: