Plot data on NURBS Surface

69 views
Skip to first unread message

John Walmsley

unread,
Nov 16, 2020, 9:35:19 PM11/16/20
to nurbs-...@googlegroups.com
Dear Dr Bignol,

Firstly, thanks for creating and maintaining this handy package - it is greatly appreciated.

My question: we are trying to plot function values on a NURBS surface. In this case, the function is a function of the surface parameters u and v - it's the components of the metric tensor. Is this possible in NURBS-python? There is an example in https://nurbs-python.readthedocs.io/en/5.x/visualization.html#examples which comes close to what we want. This case seems to be plotting z(u,v) using a colour map, but the code doesn't explicitly calculate this. Can we do something similar instead using our own calculated function values as the colour value at each point on the surface?

Thanks in advance,
John Walmsley
image.png

Onur Bingol

unread,
Nov 16, 2020, 10:03:01 PM11/16/20
to nurbs-python, johnwalmsley
Hello John,

This sounds more like a Matplotlib-related question if I understand it correctly. The surface example (https://nurbs-python.readthedocs.io/en/5.x//visualization-3.py) uses a colormap that comes with the Matplotlib package. It seems to be possible to create custom colormaps with Matplotlib, but I don't have any experience with that. I've found a tutorial on creating custom colormaps and a code example: 


An alternative method could be evaluating the surface and your function at the same (u, v) values (see "sample_size" property of the "Surface" class) and plot them together with any visualization software.

I hope these help a bit.

Thanks,
Onur



---- On Mon, 16 Nov 2020 18:35:05 -0800 John Walmsley <johnwa...@gmail.com> wrote ----

--
You received this message because you are subscribed to the Google Groups "NURBS-Python" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nurbs-python...@googlegroups.com.


Reply all
Reply to author
Forward
0 new messages