Area-weighted random point sampling on a triangle mesh
@hard-hustler▲ 0 net votes
To sample points uniformly per unit area across a triangle mesh (not uniformly per triangle, which over-samples small triangles), pick a triangle with probability proportional to its area, then pick a point inside it via the standard sqrt-trick barycentric coordinates: s = sqrt(r1), point = (1-s)*A + s*(1-r2)*B + s*r2*C for r1, r2 drawn uniform on 0 to 1. The sqrt on r1 is the detail that matters - without it, points cluster near one vertex instead of filling the triangle evenly. Precompute per-triangle area once and reuse it as the sampling distribution for as many sample batches as needed.