toxiclibs icon indicating copy to clipboard operation
toxiclibs copied to clipboard

Using the BasicNurbsSurface class

Open co-ord opened this issue 5 years ago • 6 comments

Dear toxi,

I'd like to use the BasicNurbsSurface class but haven't found a single example sketch on the web and it seems the corresponding Javadoc is missing.

Would you mind sharing a very basic example sketch demonstrating how to handle a nurb surface with toxiclibs ?

Respectfully,

solub

co-ord avatar Dec 18 '18 12:12 co-ord

@postspectacular Pardon my insistence, I've looked and asked almost everywhere about this but to no avail. I would be immensely grateful if you could provide a minimal example showing how to use a NurbsSurface with toxiclibs.

co-ord avatar Dec 31 '18 18:12 co-ord

Few days ago I've been looking through some of my backups, but still haven't found a small enough example to share. Will have another look tomorrow... Btw. to give you an idea of some basic possibilities, see: https://www.flickr.com/photos/toxi/tags/nurbs

postspectacular avatar Dec 31 '18 20:12 postspectacular

These nurbs are beautiful Karsten ! I wouldn't mind a more complex example, anything would be fine really.

co-ord avatar Jan 01 '19 12:01 co-ord

@postspectacular Could you at least please tell me how to instantiate the NurbsSurface class ? Just a snippet of any of your examples would be fine. Please !

co-ord avatar Jan 02 '19 23:01 co-ord

I'm sorry this is taking so long, but please understand that it's not as straightforward for me to dig out and through backed up projects from 10 years ago, nor is this a high priority from my side... In the meantime do have a look at the dozen or so static methods in the NurbsCreator class:

Once you have a NurbsSurface instance built, you can then pass it to the NurbsMeshCreator to convert the surface to triangle mesh with customizable resolution:

https://github.com/postspectacular/toxiclibs/blob/master/src.core/toxi/geom/nurbs/NurbsMeshCreator.java

The difference between createControlMesh() and createMesh() is that the former constructs a mesh from the surface's control points, whereas the latter performs the full nurbs interpolation and results in a smooth surface representation (depending on chosen resolution)...

postspectacular avatar Jan 06 '19 14:01 postspectacular

Thank you Karsten. I'll have a look at it and will try to post a basic example here for future users.

co-ord avatar Jan 10 '19 17:01 co-ord