[orx-triangulation] Add generated and verified documentation

This commit is contained in:
Edwin Jakobs
2025-01-19 00:13:44 +01:00
parent 8ef7264c63
commit 1752685476
5 changed files with 51 additions and 0 deletions

View File

@@ -81,6 +81,15 @@ class DelaunayTriangulation(val points: List<Vector2>) {
fun nearestPoint(query: Vector2): Vector2 = points[nearest(query)]
}
/**
* Computes the Delaunay triangulation for the list of 2D points.
*
* The Delaunay triangulation is a triangulation of a set of points such that
* no point is inside the circumcircle of any triangle. It maximizes the minimum
* angle of all the angles in the triangles, avoiding skinny triangles.
*
* @return A DelaunayTriangulation object representing the triangulation of the given points.
*/
fun List<Vector2>.delaunayTriangulation(): DelaunayTriangulation {
return DelaunayTriangulation(this)
}