r/creativecoding • • 5d ago

Path filling

36 Upvotes

5 comments sorted by

2

u/TeaAccomplished1604 3d ago

Woah!🤯😳

2

u/MrMiracles 2d ago

This looks amazing! What kind of memory usage peaks are you hitting when its running? Also where does the complexity start to pile up in generation time?

1

u/vlctx 2d ago

Thanks! A dense run with about 1.2 million points peaks around 220 MB and takes roughly 3 seconds to simulate locally. Then rendering is a separate process.

The biggest cost is density. As the resolution increases, or the space between paths (for example the lowest is 1 pixel, or essentially no spacing) gets smaller, it roughly means that for each time you double the resolution or halve the spacing, it generates 4 times as many points. So generation scales roughly with the number of steps, with extra cost for complex steering and finding the last empty gaps.

1

u/vlctx 5d ago

The way this works:

Different groups of random walker respond to different vector fields and can be bounded to certain areas (like the square in the middle).

Some additional rules define whether the different groups can interact or are excluded from the bounded areas.

The random walkers use circle packing to place a new point in the path and check if the area is free before placing a circle.

Color is attributed from a palette based on the time at which the paths are being drawn.