Iron Filings Desk
- Lab Skill
- v1.0.1
- Interactive 3D
A sheet of paper dusted with thousands of iron filings, each easing toward the local field direction from draggable magnets; a third creep up the gradient into ridges.
Example
Iron Filings Desk
The example runs in a sandboxed frame with no access to this page.
Run online
Run in a SandBase sandbox and view your results in Lab.
Open in Lab ↗What you get
Bring a set of magnets and the paper to dust. The Skill returns a downloadable Skill and a runnable filings sheet.
How it works
- 01
Place the magnets on paper
Iron Filings Desk opens a daylight paper sheet with fibre texture, registration marks and a scale bar, then carries red and blue magnets in from a tray. A brief in assets/briefs supplies the document title, note and hint. A prompt such as 'Use iron-filings-desk to scatter brass filings around two bar magnets' sets the content your agent builds.
- 02
Let the filings follow the field
src/filings.js sums softened monopoles from every bar, horseshoe and disc, and each filing eases toward the local field direction faster where the field is strong. A third of the filings creep up the field-strength gradient into pole tufts. Dragging moves a magnet, double-click flips its poles, and a tap sends a ring that jitters the filings into cleaner lines.
- 03
Build and verify offline
The scene builds with npm install and npm run build in Node and runs in any browser from one offline HTML page. npm run shoot passes 11 headless checks: filings seeded, poles built, the bridge region aligned, a flip reversing the field and a moved magnet redirecting it. The published 1.0.1 release confirms four draggable magnets, zero external requests and drag, flip and tap all working.
FAQ
What does Iron Filings Desk show?
Iron Filings Desk shows thousands of iron filings on a paper sheet lining up with the field of draggable magnets. A steel compass needle swings to the field, and an optional pencil-blue overlay traces field lines. It suits magnet toys, physics-classroom canvases and any demo that makes an invisible field visible.
Is the Iron Filings Desk magnetic field computed live?
Yes. Iron Filings Desk recomputes a pole table whenever a magnet moves and sums softened monopoles at every filing each frame. Each bar puts its poles at 0.41 of its length along its axis, a horseshoe puts two across its gap, and a disc acts as a single pole.
Why do filings in Iron Filings Desk bunch into ridges?
Iron Filings Desk lets a third of its filings creep up the gradient of field strength, not only rotate in place. Those filings gather into spiky tufts near the poles and settle under friction, so lines thicken where the field is strongest. Without the creep rule the sheet would show evenly spaced, rotated slivers.
Does Iron Filings Desk need an API key or a paid model?
No. Iron Filings Desk is plain JavaScript that runs in the browser with seeded randomness and makes no network request, so using the scene adds nothing to a SandBase bill. The release check recorded zero external requests and zero console errors. Only Node and the pinned npm packages are needed to build it.
Can Iron Filings Desk show fields other than magnets?
Yes, with code changes. Iron Filings Desk keeps the field in one function, field(x,y), plus the align and creep rule. Swapping that function for gravity wells, charges, pressure or a drawn flow lets the same filings visualise a different field. The shipped build only includes magnets.
What happens when I flip a magnet in Iron Filings Desk?
Iron Filings Desk swaps that magnet's poles when you double-click it. Where opposite poles now face each other, the filings redraw into bridging lines; where like poles face, they push apart. The headless check confirms that a flip reverses the field direction.
More Skills
All Interactive 3D Skills →
Resin Diorama
Live 3D resin-block dioramas in your browser: send a little tram across a clear turquoise sea, or ripple the bay of a cliff island. Synthesized sound, and every scene can be tuned.

3D Vehicle Worlds
Explore interactive 3D vehicle worlds in your browser, with varied terrain, camera controls and driving effects. Choose a playable example to begin.

3D Firefly Terrariums
Turn a thick glass miniature, scatter glowing fireflies and open its brass lid. Actual particles leave through the neck and return before it seals. A moonlit cabin, forest and real local lights in one offline HTML.

Jelly Candy: Fruit Bears
Six translucent fruit gummies on a white table. Grab any part and pull, lift a head until the neck stretches thin, press one flat until it springs back, flick one across the pile or pour in more. Fixed-step soft-body physics and a marching-cubes skin in one offline HTML.

WebGPU Soft-Body Gummy Bears
Four translucent gummy bears on an ivory floor, rendered with native WebGPU. A deterministic 36-second choreography stretches, presses, flips and tumbles them before they settle back to the exact rest pose. Drag any bear to stretch, squish or toss it. A fixed-step tetrahedral XPBD solver in one offline HTML.

Stone Stars: 3D Miniature Landmark City
Turn a city into a storybook 3D island around one landmark, with chapters, a daylight-to-starlight slider, street life and a matching scored 24-second film. Sample: a Gaudí-style basilica.

