Back to Powder Tool
SOURCE / PINNED RELEASE

Made of little things.

Powder Tool

Release
242076e6da24…
Author-recorded commit
c4489f440f27…
License
LICENSE
Author’s source reference
nostr://npub182jczunncwe0jn6frpqwq3e0qjws7yqqnc3auccqv9nte2dnd63scjm4rf/wss%3A%2F%2Fgit.napplet.soy%2F/n-48e516e34e5

Archive hash verified: f2fd072590aac7a5…. The source-to-build association is the author’s claim; it has not been independently rebuilt.

docs/powder-design.md
# Powder Tool build spec

nappletType: powder-tool
purpose: Paint interacting substances and experiment with movable rigid bodies in a live physics sandbox.
requires: none
NAPs used: theme (optional), storage (optional), config (optional)
SDK helpers: themeGet/themeOnChanged; storage.getItem/setItem; existing config schema registration/subscription
Fallbacks: explicit dark palette; save/load disabled without storage; local settings defaults without config
Data flow: simulation stays in memory; explicit Save writes one versioned, compact scene to scoped storage; Load validates before replacing the scene
Relay escape hatches: none
Interop: none

Must-have flows: paint sand/water/oil/fire/steam/lava/wood/wall; erase; place crates and stones; grab/throw bodies; pause and step; reset/clear; load example scenes; adjust brush and gravity; undo edits; save/load when available.

Physics: bounded cellular particle simulation with gravity, density displacement, liquid spreading, rising gases, ignition/extinguishing and lava cooling. Convex rigid bodies use gravity, angular velocity, collision impulses, static terrain contacts, fluid buoyancy/drag and particle displacement. This is a playful approximation, not a scientific solver.

Visual direction: precise instrument workbench, charcoal fallback, warm sand accent, fine grid, material swatches, textured particles, outlined timber crates and faceted stones. System sans UI with monospaced measurements. No masthead or footer; all chrome is functional.
Density: 13px base, 28px controls, 4/8/12px spacing. Coarse pointers expand controls to at least 44px.
Tiers: tiny=canvas plus compact material select and pause; compact=canvas with wrapping palette drawer; regular=persistent material sidebar and full toolbar; wide=larger canvas and expanded material descriptions; short=compact controls and scrollable drawer.
Minimum size: none; the simulation continues through resize and the scene fits without losing contents.
Theme: optional; map background/text/primary over html/body/root and all UI tokens; canvas grid follows runtime theme, materials retain their identity colors.
States: populated starter scene; blank scene with draw hint; inline save/load errors; paused indicator; no identity requirement.
Config schema: interface text size, control height and text-selection preferences (existing optional integration).

Verification: meaningful simulation regressions; guidance/type/build checks; upstream conformance with skipped coverage reported; soyLI host check; actual iframe sizes 200×160, 320×560, 900×600, 2400×1200 in light/dark; emulated touch at 390×844, 360×640, 844×390; save/load operation and missing optional domains. Capture the built simulation, then stop the owned preview.

## Higher resolution, emitters, and gases

Increase the default grid from 300 to 600 cells wide (four times as many cells at a fixed aspect ratio), with a scene-preserving 300/450/600 resolution selector. Scale brush and rigid-body dimensions with the grid. Limit grid dimensions to 720 and preserve older version-1 scenes; version-2 saves include emitter configuration and compact lossless grid data. Keep the existing storage quota check.

Add steam, smoke, hydrogen, helium, and carbon dioxide as a separate gas palette. Steam rises and can condense; smoke rises slowly and dissipates; hydrogen rises quickly and burns; helium rises and stays inert; CO₂ sinks, pools, and extinguishes fire. These remain deliberately simplified material rules.

Emitters are visible point sources, capped at 24 per scene. The Emitter tool places/selects sources. Each source has material, particles/second, outlet width, outlet direction, and enabled state. Config changes apply to the selected source; New prepares another source. Grab moves sources; Erase or Remove deletes them. Emitters obey pause/single-step, blocked outlets, save/load, undo, and resolution changes. Include a Gas lab preset with active sources to make the new behavior immediately discoverable.

NAP boundary: all added logic is local. Existing optional theme/config/storage remain sufficient; no new requires or relay access. Emitter configuration lives in the compact palette drawer on phones and in the sidebar on larger frames. Retain 44px touch targets and exact tiny-frame coverage.