Sand AISand AI MAGI-2MAGI-2 现已上线 SandBase:支持原生音频的 1080p 视频立即试用

Iron Filings Desk

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.

示例

Iron Filings Desk
在新标签页中打开

Iron Filings Desk

该示例在沙盒化的框架中运行,无法访问此页面。

在线运行

在 SandBase sandbox 中运行,并在 Lab 中查看结果。

在 Lab 中打开 ↗

你将获得什么

Bring a set of magnets and the paper to dust. The Skill returns a downloadable Skill and a runnable filings sheet.

工作原理

  1. 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.

  2. 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.

  3. 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.

常见问题

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.

Lab Skill · Interactive scenes

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.

Lab Skill · Interactive scenes

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.

Lab Skill · Interactive scenes

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.

Lab Skill · Interactive scenes

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.

Lab Skill · Interactive scenes

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.

Lab Skill · Interactive scenes

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.