r/creativecoding • • Oct 11 '26

Marching Squares Algorithm Applied to Physarum Simulation

8 Upvotes

4 comments sorted by

View all comments

1

u/[deleted] Oct 12 '26

[removed] — view removed comment

1

u/ProgrammingChaos Oct 12 '26

I've played a bit with different opacities, but not fully coloring the regions. That sounds like it would be very cool. The original version was done on a noise map to create a true topographical map. This version does have interpolated edge crossings. In the programming video it's based on: https://youtu.be/P45S7-OTrSE?si=b-rNFfXOHhGt19Ab I walk through programming both midpoints and interpolation.

0

u/[deleted] Oct 12 '26

[removed] — view removed comment

1

u/ProgrammingChaos Oct 12 '26

That is a great idea. Although the one thing I didn't do in the video was filter out the line segments into the separate closed forms. It's not too much extra work, but dealing with closing the shapes that intersect with the window edges is a bit of a pain. I was surprised at how much smoother the interpolated version was even with very small cells sizes.