Coding Example: Blue Noise Sampling using DART method

In this lesson, we will try to do the blue noise sampling using the DART method discussed in the previous lesson. We will look at both solutions, i.e., Pythonic and NumPy approach and see which one is more efficient.

We'll cover the following

Let’s consider the unit surface and a minimum radius r to be enforced between each point.

Knowing that the densest packing of circles in the plane is the hexagonal lattice of the bee’s honeycomb, we know this density is d=16π3d = \frac{1}{6}\pi\sqrt{3} (in fact I learned it while writing this course). Considering circles with radius r, we can pack at most dπr2=36r2=12r23\frac{d}{\pi r^2} = \frac{\sqrt{3}}{6r^2} = \frac{1}{2r^2\sqrt{3}}.

We know the theoretical upper limit for the number of discs we can pack onto the surface, but we’ll likely not reach this upper limit because of random placements.

Furthermore, because a lot of points will be rejected after a few have been accepted, we need to set a limit on the number of successive failed trials before we stop the whole process.

Python Implementation

Get hands-on with 1400+ tech skills courses.