Hi there. I’m working on some 3d visualizations of NurbsSurfaces and started using verb.
In the repo of verb there are some example functions to convert a surface to a Three.js geometry, but as Geometry and Face3 are deprecated, could anyone point me in the right direction to convert this function using BufferGeometry?
function tessellateSurface(srf) {
var tess = srf.tessellate();
var geometry = new THREE.Geometry();
geometry.vertices = asVector3( tess.points );
geometry.faces = tess.faces.map(function(faceIndices){
var normals = faceIndices.map(function(x){
var vn = tess.normals[x];
return new THREE.Vector3( vn[0], vn[1], vn[2] );
});
return new THREE.Face3(faceIndices[0],faceIndices[1],faceIndices[2], normals);
});
return geometry;
}