What's are some relatively easy ways to accomplish the following in a 2D sketch?
Create Vogel model of Fermat's spiral:
150-circle example
r = c * sqrt(n)
θ = n * 137.508°
where θ is the angle, r is the radius or distance from the center, n is the index number of the hole and c is a constant scaling factor. The angle 137.508° is the golden angle which is approximated by ratios of Fibonacci numbers.
Given parameters for:
- A count of identically-sized circles (will later extrude as holes) to generate
- A diameter of each of those holes
- A minimum distance between those holes
I cannot explain either the spiral nor Vogel's model better than Wikipedia. The picture shows an example that might be generated for 150 such circles.
Why?
I want to generate holes corresponding to such a pattern, in which to mount WS2818 "bullet" form LEDs (individually-controllable, weatherproof RGB LEDs). These LEDs snap into 12mm holes. Thus, if automated, this would simplify generating the patterns at multiple sizes. The hard part is ensuring minimum distances between the circles (ensure minimum amount of material between LEDs, so less likely to break when they are inserted/removed).
I imagine this might be a repetitive process that has to adjust the initial LED starting point on the spiral.
1. Generate potential points on fermat's spiral
2. Test nearest-neighbor distances of those points to ensure minimum distance requirement is met
3. repeat with different starting point to find closest packing (within tolerance)?
Given the final resulting points:
4. Take final points, generate circle centered at each one.
BONUS: Given a border that contains those final resulting circles, and the final resulting points:
5. Generate Voronoi diagram
(The bonus is for creating partitions in a diffusing cover, with one partition per LED... it just looks neat that way)