Does anybody know method or algorithm how to fill mesh triangles array automatically?
This is extremely dependent on the shape. All the primitives can be created mathematically, however more complex shapes are going to be increasingly difficult.
What Mesh shape are you looking to create?
For example Sphere.
I want to understand how triangulation algorithm is working and after that may be I’ll be able to cap mesh, for example to delete half cylinder or sphere(delete vertices and triangles) and fill hole (append new triangles combination in triangles array)
I fear there is no “triangulation algorithm” that you can just use.
there are multiple ones but all of them are of polynomial runtime and none of them is trivial to understand.
If things like Vornoy diagram and graph theory arent among your “common knowledge” you have a good chance of not even understanding their introductions as there is quite some higher university math and theory behind it.
This might be useful…
“poly2tri - A 2D constrained Delaunay triangulation library”:
BR, Juha