Hello again! So I implemented a new algorithm to cut polyhedrons on the top, it works flawless except on shapes with concave vertices, I can’t share the entire project but I made two Playgrounds to show my problem.
Those are made with the exact vertices and faces that my project gives in debug just for reference.
So to explain what I do inside the project is to simply get the height of the cutting point and then find the x and z to get the exact points where to cut, and then replace the old points with the new ones to get the faces corresponding to the figure, the top face is just made with the top points in order but it fails when finds a concavity creating a weird shape in it.
is there any way to fix this weird shape on the top face with babylon?