Reputation: 1
I have a set of points on 2D plane, each has its screen coordinates X and Y. They are placed this way:
You see they are placed in horizontal lines, but X coordinate is quite random. A number of points in each line is not necessarily the same.
Given these coordinates, I need to generate triangles so that each edge of the triangle connects a pair of points which are close to each other, if possible:
Is there any known algorithm or library for this?
Upvotes: 0
Views: 371
Reputation: 80297
You need point set triangulation.
In described case Delaunay triangulation should give desired result.
Library by J.R.Shewchuk (and it's not hard to find triangulation implementation for any popular language)
Upvotes: 2