Mesh generated with ThreeCsg and problem of vertices




I have a problem with the shadows of a cone to which I subtracted a smaller cone.


cone lightblue -> no action
cone green -> computeVertexNormals
cone violet -> mergeVertices and computeVertexNormals

I can’t find a solution
Can someone help me?



The way CylinderGeometry is generated does not allow the usage of .computeVertexNormals(). (Vertices of the caps are not shared with the torso so uv mapping works correctly).

It is normally not necessary to call .computeVertexNormals() since the normal vectors are already calculated. The default geometries in three.js are not intended for that sort of of post-processing.


Thanks for the reply.

I did not understand well but I changed the approach.

I draw a section and do a circle extrusion.
The result is better but not perfect.

How should I proceed because the geometry is flat at the top and bottom but smoothed on side ?

here is the example


Like i said before, what you are doing in your code is not supported by three.js's default geometries. Recalculating the normals via .computeVertexNormals() does not always produce proper results.


That circle extrusion is a bit exotic approach. I’d offer to use THREE.LatheGeometry().
Well, I’ve tried it, but the result is far from ideal :slight_smile:



I can’t use LatheGeometry because I have to create a more complex object

I have to do this


I’ve updated my jsfiddle from the previous message with the profile that you provided in the picture. It works as expected. I see no problem with using THREE.LatheGeometry() in this case.



Ok now I understand :slight_smile:

Thank you so much you helped me a lot

Last example


You’re welcome :wink: