How to build a custom mesh for a given polygon having linearRing boundary?

I have a polygon having a linearRing boundary which is parsed from citygml. Using citygml4j library, I got all 3d postions of the linearRing.

From these positions, anyone who knows how can i parse them into triangles to build a custom meshe (like this https://wiki.jmonkeyengine.org/legacy/doku.php/jme3:advanced:custom_meshes) ?

Remember that these positions are located in the boundary of the polygon, does not inside the polygon.

Thanks for any suggestions.

Do i need some methods “Polygon triangulation” to do it ?

If yes, which method is best suit ? any one who know library name or java code example to do it ? Thanks for any reponse.

Do your polygons have holes? In the end it sort of depends on your skill level for implementing the algorithm. I don’t know if anyone has posted a general polygon triangulation yet.

In the end it’s just a matter of simplicity to code versus performance requirements. I think the ear clipping method could be pretty simple and pretty fast, though.

Tks for your reponse quickly. No, my polygon has not any holes. They’re simple polygons. I have heard about clipping method.

I google a source like this

I try it firstly.

Finally, i got it. I used library QuickHull3D (http://www.cs.ubc.ca/~lloyd/java/quickhull3d.html) to triangles all vertices and it works.