mrdoob / three.js

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

NURBS #1799

Closed MasseGuillaume closed 4 years ago

MasseGuillaume commented 12 years ago

I have some spare time.

@mrdoob is it something you want in three.js ?

On CPU: http://cgit.freedesktop.org/mesa/mesa/tree/src/glu/sgi/libnurbs/interface/glinterface.cc?h=8.0 ( restrictive license ) https://svn.blender.org/svnroot/bf-blender/trunk/blender/source/blender/blenkernel/intern/curve.c ( GPL ) http://www.nar-associates.com/nurbs/c_code.html ( copyright, non commercial reuse ok )

On GPU: http://kingkong.me.berkeley.edu/~adarsh/Papers/CAD09.pdf 10 X faster but high setup cost

Rendolf commented 11 years ago

Yes, so do I but I need to create NURBS surfaces using NURBSForTHREE and i can't :)

sntx commented 11 years ago

Hi @Rendolf I'll try to get you a working example on the weekend, meanwhile you could try hacking into this example: code: http://lirius.org/cumulus.tar.gz live: http://lirius.org/cumulus/ let me know how it goes

Rendolf commented 11 years ago

Hi, it would be really great. I have seen your example but it is too advenced. I am looking for something easy to create surfaces and maybe to texture them. I tried to do this on my own but without result. My code:

 var nknots = {
    u: [0,0,0,0,0,1,1,1,1,1],
    v: [0,0,0,0,0,1,1,1,1,1],    
}
var norders = {
    u: 5,
    v: 5,   
}
points=[];
points3=[];

points.push( new THREE.Vector3 ( -10, 10, 0 ) );
points.push( new THREE.Vector3 ( -10, 3.3, 0 ) );
points.push( new THREE.Vector3 ( -6.6, -6.6, 0 ) );
points.push( new THREE.Vector3 ( 3.3, -10, 0 ) );
points.push( new THREE.Vector3 ( 10, -10, 0 ) ); 

points3.push(points);
points3.push(points);
points3.push(points);
points3.push(points);
points3.push(points);

pNurbs = new THREE.NURBSSurface(points3, nknots, norders); 
var gNurbs = new THREE.NURBSSurfaceGeometry(pNurbs, 20, 20);
var ggNurbs = new THREE.Geometry();

And now i do not know what to do next. Can someone help me?

bhouston commented 11 years ago

Be aware that a number of Three.js functions have changed their interfaces since this library was created. It is a nice library.

Rendolf commented 11 years ago

Yes but i use version that is included in NURBSForTHREE. Finally I managed to create NURBS surface but I think that texturing them was not implemented:(

gcstar commented 11 years ago

HI @sntx ,sorry to bother you. how can I use NURBSForTHREE to draw a Free-form NURBSface ?

Rendolf commented 11 years ago

Hi, I am not sntx but i also had problem with NURBS surface. My example http://prprzejsciowka.cba.pl/NURBS_przyklad.html

WestLangley commented 11 years ago

If you are looking for help, please be aware of the following:

As stated in the guidelines, help requests should be made in stackoverflow. This board is for bugs and feature requests.

Tectract commented 9 years ago

Hi guys, I'm also interested in NURBS modeling, and I have a little pet C++11 project I've been working on called OpenNURBS, I have it stamped with the Mozilla License. Specifically the features I'm working on require curve and surface offsetting and extrusion, and filleting, and finally sub-surface collision detection and minimum distance computation. It's part of a BioFractal Tree project, with the goal of creating intertwining, non-overlapping, space-filling "bio-fractal" tree and network geometries and meshes. The offsetting requirement is to support inner/outer walls for modelling and simulation of arteries/veins/capillaries. The filleting requirement is to join the base of new tubes to existing fractal trees. We need distance computation and collision detection to figure out the baseline paths of new branches as the network grows, and eventually multiprocessor competition and nearest-neighbor detection to help that along, as it grows exponentially in computational requirements.

I'm interested in possible incorporating code or helping translate algorithms back and forth between javascript and C++11/14 for curve / surface offsetting, extrusion, filleting, collision detection, and minimal distance computation. If there are other FOSS NURBS project people that want to just collaborate on the C++ side also, I'd like to look at that, @sntx. OpenNURBS will have it's own GUI, but I'd also like to support outputting geometries / meshes into a format that could be easily loaded into Three.js / webGL. I have some crystal equilibrium surface and surface-energy generators that I'd like to see repurposed for OpenGl / webGL, if I can translate these old MATLAB programs into c++ / javascript and have an easy way to output to Three.js / webGL.

dmtaub commented 9 years ago

Just as a point of reference https://github.com/pboyer/verb On May 16, 2015 6:57 PM, "Tectract" notifications@github.com wrote:

Hi guys, I'm also interested in NURBS modeling, and I have a little pet C++11 project I've been working on called OpenNURBS, I have it stamped with the Mozilla License. Specifically the features I'm working on require curve and surface offsetting and extrusion, and filleting, and finally sub-surface collision detection and minimum distance computation. It's part of a Bio-Fractal Tree project, with the goal of creating intertwining, non-overlapping, space-filling "bio-fractal" tree geometries and meshes.

I'm interested in possible incorporating code or helping translate algorithms back and forth between javascript and C++11/14 for curve / surface offsetting, extrusion, filleting, collision detection, and minimal distance computation. If there are other FOSS NURBS project people that want to just collaborate on the C++ side also, I'd like to look at that, @sntx https://github.com/sntx. OpenNURBS will have it's own GUI, but I'd also like to support outputting geometries / meshes into a format that could be loaded easily into Three.js / webGL easily also. I also have some crystal geometry generators that I'd like to see repurposed for OpenGl / webGL, if I can figure out an easy way to translate these old MATLAB programs into c++ / javascript and have an easy way to output to Three.js / webGL.

— Reply to this email directly or view it on GitHub https://github.com/mrdoob/three.js/issues/1799#issuecomment-102709754.