TITLE: Distribute a fixed number of points "uniformly" inside a polygon
QUESTION [12 upvotes]: I have a polygon in 2D (defined by a series of Vertex $V$ with coordinates). The polygon can be convex or concave. I have $n$ number of fix points I can put inside the polygon.
The question is, how can I distribute the fix points as uniformly as possible inside the polygon? 
The motivation for this question is I want to create a mesh generator and I want all the triangular elements $E$ ( which is defined by a list of vertices $V$) to look good with no too small or too large angles. In order to control the granularity of the mesh I am thinking about using the number of fix points $n$ as the controlling parameter. The fix points are used to control the vertex of the triangular elements. 
Is there any algorithm for this?

REPLY [4 votes]: I came across this problem as well and have solved it by using K-means clustering. 
For a given polygon, I generate N random cluster centers in the polygon's shape. For each center, I find the cluster of pixels in the polygon that are closest to this center (this is a Voronoi fragmentation of your shape). Iteratively move the centers to their respective cluster's center of gravity. 
Note that this is a heuristic that doesn't guarantee to find the optimum distribution; when the iterations stabilize, you have found a local minimum that serves as an approximation of ideally uniformly distributed points in your polygon shape.
Here's an example result of 100 points uniformly distributed over a cloud shape and their respective (Voronoi) areas of influence