Hi there,
I’m trying to extrude a mesh with a set of points. ExtrudePolygon worked well, but instead of polyline, I’d like to build a smooth curve of the top of the shape.
For example: https://www.babylonjs-playground.com/#MCJYB5#1
First point is to make sure shape points are in counter clockwise order. For polygon2 your line points start at (0, 0, 2) and end at (10, 0, 2) and so your catermull points to close the shape need to go from (10, 0, 2) round to (0, 0, 2). Since your catermull points would be in clockwise order when added after the linePoints I reversed them in line 37 to generate all the points need for the polygon. I add them after the linePoints on line 39.
So allPoints is now the array of all the points in the correct order needed to form the shape for the extruded polygon.