Feb 19, 2011

Random points distributed inside a triangle.

For a particular project for the office where I work, this month I had to develop a random distribution of points inside a triangle using Grasshopper. The aim is then to CNC cut holes in a complex triangular mesh, so I started from a single triangle to understand the geometry and the mathematical possibilities to perform this operation.

If you need to create a random series of points on a surface, it is very simple: you just divide the surface using U and V parameters... and you can randomize U and V to obtain a random result.

The problem is that the distribution is not entirely random, but it follows the U and V pattern.
For a Sphere you will obtain points more concentrated on the poles.
In this particular case, in a triangle, you will obtain the points more concentrated in one of the vertices.

(the image show just the UV subdivision, without any random function)


After a brief research I discovered some possible solutions to solve this issue.