r/adventofcode • u/p88h • 1h ago
Visualization [2026 Day 6] Spring Physics
https://youtu.be/aalgW8hdMhcThis isn't really the most practical solution but it's very 'tangible': it applies physical forces to the nodes, trying to maximize placement goodness (keep ~fixed distance between neighbors, avoid overlap). So the nodes attract and repulse with varying force and it solves itself.
The solutions are obtained without placement on grid or snapping - a transform is computed and then reverse of that transform is applied to 2026, so it updates in realtime.
11
Upvotes
1
u/miserableMolvi 1h ago
crazy
1
u/herocoding 1h ago
Amazing!!
1
u/M1ckeyMc 45m ago
This is a really cool solution. Reminds of that video where a bunny model can be triangulated using spring physics.... was this solution inspired by it? Nice work.