Cabochons (CabochonGeometry)

I had noticed the problem too, but I’m not as quick to respond as the author himself. :running_man:

In my geometry examples hofk (Klaus Hoffmeister) · GitHub I had the problem more often. In the last examples I wrote myself an extra function to not have to think about it every time.


function smoothEdge( idxa, idxb ) {
    
    const v3a = new THREE.Vector3( );
    const v3b = new THREE.Vector3( );
    const v3  = new THREE.Vector3( );
    
    v3a.set( g.attributes.normal.getX( idxa ), g.attributes.normal.getY( idxa ), g.attributes.normal.getZ( idxa ) );
    v3b.set( g.attributes.normal.getX( idxb ), g.attributes.normal.getY( idxb ), g.attributes.normal.getZ( idxb ) );
    
    v3.addVectors( v3a, v3b ).normalize( );
    
    g.attributes.normal.setXYZ( idxa, v3.x, v3.y, v3.z );
    g.attributes.normal.setXYZ( idxb, v3.x, v3.y, v3.z );
    
}

Used at Curved2Geometry - a twofold curved geometry and Multi Form Geometry in a similar form.

1 Like