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