Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tessellation step #20

Closed
atwaves opened this issue Nov 27, 2015 · 3 comments
Closed

Tessellation step #20

atwaves opened this issue Nov 27, 2015 · 3 comments

Comments

@atwaves
Copy link

atwaves commented Nov 27, 2015

Hi Peter. How to decrease step of tessellation for surfaces? Need smoother edges

untitled
untitled2

Code:

    var c0 = verb.geom.NurbsCurve.byKnotsControlPointsWeights( 4, [0,0,0,0,0, 1,1,1,1, 1], [ [-108, -15, 0], [-44, -10, 0], [-18,-5,0], [-8,-2,0], [-1,18,0] ], [ 0.1, 0.2, 0.3, 0.4, 0.5 ] );

    var c1 = verb.geom.NurbsCurve.byKnotsControlPointsWeights( 4, [0,0,0,0,0, 1,1,1,1, 1], [ [-108, -19, 10], [-44, -14, 11], [-18,-9,8], [-8,-6,4], [-1,14,6] ], [ 0.1, 0.2, 0.3, 0.4, 0.5 ] );


var curves = [c0, c1];
var srf = verb.geom.NurbsSurface.byLoftingCurves( curves, 1 );

addMeshToScene( srf.toThreeGeometry() );
curves.forEach(function(c){ addCurveToScene( c.toThreeGeometry() ); });
@pboyer
Copy link
Owner

pboyer commented Nov 29, 2015

You can pass an object to NurbsSurface.tessellate that controls the tessellation process. This is the AdaptiveRefinementOptions object. It's described in more detail here:

http://verbnurbs.com/docs/eval/Tess/#adaptiverefinementoptions

You can find the defaults here:

https://github.com/pboyer/verb/blob/master/src/verb/eval/Tess.hx/#L358

You'd typically do:

var mesh = surface.tessellate({ normTol: 0.001 });

Adjust the normal tolerance to yield more triangles.

I warn this will change a bit in the upcoming 2.1.0 release, but not much and I'll document it better this time around.

@pboyer
Copy link
Owner

pboyer commented Nov 29, 2015

Let me know if this helps...

@pboyer
Copy link
Owner

pboyer commented Nov 30, 2015

Please reopen if you need more help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants