BuckyBounce: Molecular Physics & Euler Topology Lab
An interactive Three.js structural mechanics playground exploring nanoscale allotropes, spring-mass lattice dynamics, harmonic resonance sweeps, and Euler face extraction.

Arcade mode — fire energy probes through holographic pentagonal target rings on the C₆₀ fullerene


What started as an impulse to explore mechanical physics through expanding Hoberman breathing spheres quickly evolved into building a real-time molecular physics laboratory in Three.js. A spring-mass network based on the 60-vertex truncated icosahedron provided the ideal playground: 90 covalent bonds modeled as damped Hooke's law springs () and solved with sub-stepped numerical integration, paired with Web Audio FM synthesis for tactile collision clacks.
To turn the simulation into an interactive structural mechanics testbed, the engine needed topological awareness. A chordless minimal cycle traversal algorithm parses raw node-link graphs to extract 2-manifold faces dynamically, locating the exact 12 pentagons and 20 hexagons predicted by Euler's polyhedral formula (). Those 12 pentagonal topological defects became holographic arcade target rings for high-speed probe ricochets with pentatonic chime sweeps and combo scoring.
The project expanded across six distinct allotropes and structural architectures—from armchair carbon nanotubes and graphene sheets to floating tensegrity icosahedrons with isolated compression struts suspended in continuous tension networks. A harmonic driving oscillator sweeps excitation frequencies to reveal natural eigenmode resonances in real time, accompanied by thermal strain heatmaps, yield-stress covalent bond snapping, and laser-weld lattice repair.
Timeline
Dropped into a dark room — a BuckyBounce AI export straight from Google AI Studio — and found 60 physics bodies bouncing correctly but leaking AudioContexts on every collision. Found a Vite + React + Three.js codebase with a working Hoberman breathing sphere, gravity gun, shatter/reform mechanics, and FM-synthesized impact audio. The core physics loop was solid: damped Hooke's law springs () with elastic boundary collisions. But every node collision spawned a fresh AudioContext instead of reusing a shared one — 6,598 console errors in a 3-minute session. A geometry rotation TS error broke the initial render path. Both were 15-minute fixes once diagnosed: lazy-init a single AudioContext, cast the rotation properly. The initial cleanup — import map removal, Tailwind CDN→npm migration, API key migration to import.meta.env — had already run. Two hours of recon, two surgical fixes, and the export went from "crashes with a wall of red" to "60-body spring-mass sim running clean at 60fps."
What started as an impulse to explore mechanical physics through expanding Hoberman breathing spheres quickly evolved into building a real-time fullerene spring-mass simulator in Three.js. Generating the 60-vertex truncated icosahedron required deriving 12 golden-ratio () vertices of an icosahedron dual, normalizing them to a sphere, dividing each connecting edge into thirds, and wiring the nearest triples to produce 90 covalent spring links. Each bond acts as a damped Hooke's law spring (), solved with sub-stepped Euler integration to prevent explosive instability under high restitution. Added an interactive impulse punch system that deforms the molecular cage on click and bounces elastically off canvas boundaries, paired with Web Audio API frequency-modulation (FM) synthesis that produces a crisp metallic clack on every collision.
Taking BuckyBounce from prototype to shipped repo required taming two very different physics engines: in-browser audio concurrency and macOS window focus. Eliminating the 6,536 audio console errors took a lazy singleton AudioContext paired with a 50ms cooldown and a strict 5-sound concurrency limiter in utils.ts. But the real friction hit during asset capture, burning nearly 60% of the launch session's effort on screen recording and demo GIF generation. The Antigravity IDE stole window focus between every automated tool call, while 60fps shatter physics hurled atoms offscreen in under 300ms—consistently leaving screencapture with an empty viewport. Solved both by scripting AppleScript window hiding and extracting discrete frames from a 125-second screencast using ffmpeg timestamps. Shipped 24 files and 5,399 insertions in commit 7866c8d, then turned the bruised session into a lasting rule for our capture skills: lessons are earned, not learned.
To turn an elastic bouncing buckyball into an arcade physics challenge, the engine needed to recognize molecular faces rather than just raw vertices and edges. Implemented a chordless minimal cycle traversal algorithm that parses the raw node-link graph to automatically detect 2-manifold faces, extracting exactly the 12 pentagons and 20 hexagons governed by Euler's polyhedral formula (). Transformed the 12 pentagonal topological defects into glowing holographic target rings oriented along their outward surface normals. Built a high-speed projectile slingshot mechanic that lets you fire particle probes through the molecular cage, rewarding precision ring threading with procedural pentatonic chime sweeps and exponential combo multipliers when ricocheting off interior nodes.
Upgraded BuckyBounce into a structural mechanics laboratory featuring 6 allotropes, harmonic resonance sweeps, and catastrophic bond fracture. Expanded the geometry engine beyond to generate fullerenes, armchair carbon nanotubes, graphene honeycomb sheets, geodesic domes, and 6-strut tensegrity icosahedrons with isolated compression bars suspended in continuous tension networks. Implemented a harmonic driving oscillator to sweep excitation frequencies () and reveal natural eigenmode vibrations in real time. Dynamic vertex shaders map Hooke's strain tensors into thermal heatmaps (cyan yellow red), triggering covalent bond snapping when local strain exceeds yield strength—complete with a laser-weld synthesis tool to reconstruct shattered lattices atom by atom.
Rebuilding BuckyBounce into a full structural laboratory meant expanding far beyond fullerenes to simulate true tensegrity dynamics in Three.js. Constructed a 6-strut tensegrity icosahedron where 6 rigid compression bars remain completely isolated from one another, suspended purely in dynamic equilibrium by 24 continuous elastic tension tendons. To transform the toy into an educational engine, built 666 lines of pedagogical interfaces spanning an interactive 3D Codex modal, structural puzzle challenges, and an AI Architect prompt interface that uses structured Gemini JSON schemas to generate custom spring constants and gravity vectors on the fly. Handled 6 distinct structural allotropes across 670 lines in geometry/structures.ts, wiring real-time Euler polyhedral validation into the HUD. Shipped 3,530 insertions across 21 files in commit 519aa35 after 513 agent steps, turning a simple bouncing sphere into a deep material science playground.