ShapeUtils.triangulateShape: How to create faces using vector3

or how to transform vector3.z = 0

javascript - How to create a custom mesh on THREE.JS? - Stack Overflow

Triangulation is only for 2D shapes. Currently you won’t find any triangulation libraries in javascript that work in 3D. You will have to work around. One solution would be to use a rotation matrix to rotate your 3D shape into the x-y plane and then triangulate and rotate the result back with the inverse matrix

Could you be more specific and tell us more about what you try/do/want to achieve?

Triangulation is only for 2D shapes

Yes, but it doesn’t clarify your goal.

Also, feel free to search the forum: Texture on dynamically created object

For true 3D surfaces, this is a very complex issue.

I have worked on this for specific cases.

See Addon for triangulation of implicit surfaces/ forms with holes