Circle-Fitting Relaxation

Poisson-disc samples, relaxed by two forces. Click (or tap) the canvas to restart; hover to inspect one node.

The repulsion from the k nearest neighbours yj is $$f(x) = \sum_{j} \left( \frac{h}{|x - y_j|} \right)^{m} (x - y_j),$$ and each step blends it with the pull toward ĉ(x), the centre of the least-squares circle through the neighbours (Kåsa, 1976): $$\Delta x = \omega\, f + (1 - \omega)\, \big(\hat{c}(x) - x\big).$$

σ is the root-mean-square deviation of the neighbours from their fitted circle, in units of the spacing h: zero for a perfect ring. Each point is coloured by its own σ. ψ6 compares the directions to the six nearest neighbours with a perfect hexagon: 1 is hexagonal, near 0 is random. (At k = 3 a circle fits three points exactly, and σ stops meaning anything.)

The black squares are fixed. The first ten iterations run pure repulsion with a ramped-in step clamp; after that the sliders take over. A hard floor keeps every pair at least 0.7 h apart; the repulsive shift and the total step are clamped to 0.2 h, the step is damped by ½, and neighbour lists refresh every five iterations.

Inspired by the beautiful visualizations of Jason Davies.

#Meshless   #Node-Generation   #Visualisation  

← Back to the gallery