This is from a series of stuff I did with chains of shapes, essentially. It gets more interesting as it goes on (or so I think ๐ )
One last before we move on to some other shape
Thank you for explaining your approach. I guess for this number of circles performance is not an issue. (It seems like a lot of cross-checking, but ๐คทโโ๏ธ)
Yes, it's very wasteful. You can of course do optimizations. I've considered stuff like dividing the canvas into quadrants (or maybe recursive quadrants, I think this has a name), then place the circles in lists for each quadrant and use an initial check to see which quadrant your current guess falls in, then only do overlaps with the list of circles for that quadrant. This would probably reduce the amount of overall checks considerably. But I haven't bothered, the compute/render time is under a second for the above images, so it doesn't matter ๐
Adding a flow field of Perlin noise
None of these shapes seem to overlap. How do you avoid collisions?
Inelegant, indulgently inefficient circle packing. It's quite simple, really. For two points (x1,y1) (x2, y2) we can calculate the distance between them we with the formula sqrt((x2-x1)^2 + (y2-y1)^2) . So, for two circles A and B defined by their center coordinates and a radius each, we can calculate the distance between the centers, and see if it is smaller than or equal to (depending on your taste) A.radius + B.radius, well, then they overlap ๐ค So if you want to pack just a bunch of circles on a canvas, pick a random position and radius, then check for overlaps with already placed circles. If none, put the circle in the list of placed circles and go again. If there's an overlap, increment your" missed_guesses" counter and see if you've hit your predetermined max. If you have, stop entirely, you're done, the end. If not, go again. Then at the end, render your placed circles ๐ค (or interleave your rendering with your calculating, that can be fun as well)
For my chains, I just pick a random point and generate the chain of circles according to Perlin noise or whatever, then check each circle in the chain for overlaps with already placed circles. If any, I drop the chain and try again. If none, add the circles of the chain to the list of placed circles and go again ๐ค
Adding the flow field absolutely nails it IMO chef_kiss Makes it feel very aquatic.
Half circles, just playing with shapes again
Next up: chained squares
so beautiful, those could be pen plotted I imagine
Thank you so much ๐ค I'd love to experiment with a pen plotter ๐ค
I thought I'd see how interlaced circles and squares looked ๐ค
Intersecting chain links
I'd love to continue this particular thread, but I don't have any more material right now. I have some ideas, some concepts that I actually set out with from the very beginning, but I'm just too busy with other stuff (work/life responsibilities).
Thanks ๐ I really enjoy flow fields! Such an easy way to generate movement, and you can hitch whatever you want onto it.
Another image of flow-fielded chained squares, but with different size parameters, I guess? Can't recall.
Varying sizes of chain links
Flow-fielded chained squares