mrdoob / three.js

JavaScript 3D Library.
https://threejs.org/
MIT License
101.88k stars 35.32k forks source link

Loft NURBS #23708

Open EdgeCaseLord opened 2 years ago

EdgeCaseLord commented 2 years ago

In most of the common 3d applications, there aare different types of NURBS object, one of the most useful ones are Loft NURBS where one can define the shape of an objects by curves. For now, three.js supports only very few of these NURBS objects, and neither of them accepts a curve as input - just arrays with vertices.

I'm always frustrated when I have an object that I cannot directly use as input. The way it is now, I'd have to extract vertices from a curve, put these into an array and feed this array into the NURBS object's constructor.

I'd like to see support for more types of NURBS objects (with proper documentation) than those that are already implemented, like Loft NURBS. These should be able to directly get the defining curves as input, instead of vertex arrays.

I want to be able to define curves based on mathematic formulae and make smooth surfaces of 3d objects out of them (in this case, I'm working on procedurally generated mushrooms).

I have considered using other libraries, but in this case, my customer wants to keep the project as small as possible, ie no external libraries are allowed.

fungus 1 Screenshot shows different types of NURBS in Cinema 4d.

mrdoob commented 2 years ago

No one has worked on the NURBS code in quite a while...

EdgeCaseLord commented 2 years ago

I thought either that, or it has to be brand new, lol. This one looks promising. Gonna check it out tomorrow. http://verbnurbs.com/docs/

EdgeCaseLord commented 2 years ago

PS: Huge respect for your work, @mrdoob. Highly appreciated.