Adom Wiki
Public Made by Adomby adom
How the Adom Wiki (wiki.adom.inc) works and how to drive it with the adom-wiki CLI: the two storage layers (git page repo vs package registry), hosting source by pushing files (not a tarball), making packages, cutting per-platform releases, and the three-tier skill layout (user skills ship, dev-skills/ and publish-skills/ stay source-only). adom-wiki is the current tool; adompkg is deprecated. Read this first before publishing or installing.
Interactive 3D viewer — downstream consumer needs (custom Layers, sandbox-safe init, frameModel, build drift)
Interactive 3D viewer — what downstream consumers need
Filed against adom/wiki since kyle/adom-3d-viewer-babylon9 is deprecated.
Context. We built an interactive Static / Pick-and-Place viewer for the basic-parts component pages (live on aravk/in-s42atr + the 10 other basic-part LEDs). It runs on the shipped adom-3d-viewer.min.js (window.Adom3DViewer) with our additions layered on top as host-page code. Everything below is something we had to work around locally, and would rather consume from the viewer itself. Nothing here is about page embedding — this is all the viewer engine.
Bugs
1. SceneBuilder aborts when storage access throws → scene renders unlit.
In any sandboxed context (an iframe without allow-same-origin), touching localStorage/sessionStorage throws a SecurityError. The viewer touches them during init, SceneBuilder aborts, and you get a camera + your model but no hemi/spot lights, no IBL, no shadows, no skybox — a dark, flat scene with no error surfaced.
Workaround: shim both storages with no-ops before the bundle loads.
Ask: wrap storage access in try/catch and degrade gracefully.
2. frameModel() frames the skybox, so small models come out sub-pixel.
The fit includes the 5000-unit skybox, leaving the camera at radius ~2500 m. A mm-scale part is then a sub-pixel dot and reads as "blank render".
Workaround: call frameModel() for its light/ground placement, then overwrite the camera with an explicit mm-scale target/radius/near/far.
Ask: exclude skyBox / ground / viewCube / axis helpers from the fit bounding box.
3. setGroundVisible(true) rebuilds the ground and discards consumer customization.
Toggling the ground off and back on recreates shadowGround with a fresh default material, so any consumer styling is silently lost.
Ask: preserve the ground's material/state across visibility toggles (or expose a ground-style hook).
Feature gaps
4. The Layers vocabulary is hardcoded — this is the big one.
A node only becomes a Layers toggle if its name is in a fixed map (fr4_board, pad_top, pad_bottom, solder_top, solder_bottom, paste_top, paste_bottom, silk, silk_top, silk_bottom, barrel, pin1_marker). Custom nodes never appear, and there's no extras-based escape hatch. For LEDs we need LED_lit (emitter on/off) and fov_cone (emission cone) as first-class layers.
Workaround: we built an entire parallel Layers panel.
Ask: either add the keys, or — better — a generic mechanism (e.g. extras.adomLayer = { key, label, group }) so any GLB can declare its own layers without a viewer release.
5. No per-mesh hover tooltips.
The tooltip system is ViewCube-only (uiCallbacks.onTooltip). We want hover tooltips on scene meshes with consumer-supplied content — for us: FOV cone → 2θ½ in degrees, solder fillets → radius/height, pads → dimensions, carrier tape → pocket Ao/Bo/Ko and sprocket Do/Po/E, board → thickness.
Workaround: built our own on scene.pick / multiPick, reusing your tooltip styling so it still feels native.
Ask: a public hover API (onMeshHover / per-mesh extras.tooltip) using the existing tooltip renderer.
6. setBottomLight() is missing from the shipped bundle.
The API is expected by consumers but the shipped build creates no bottomLight, so the call is a no-op.
Workaround: synthesize our own downward hemispheric light.
Ask: ship it.
7. loadModel() doesn't register the loaded model for shadows.
The current source registers loaded meshes as casters/receivers; the shipped bundle doesn't, so models land shadowless.
Ask: ship the current behaviour, and expose the shadow map's refreshRate so animated content keeps its shadow updated.
8. Adom3DViewer.BABYLON exposes only ~5 classes.
Currently MeshBuilder, StandardMaterial, Vector3, Color3, DynamicTexture. Anything else (e.g. TransformNode, Color4) has to be harvested off a live instance's .constructor, which is brittle.
Ask: expose the full Babylon namespace, or a documented, stable subset.
9. No capture/screenshot API, and no preserveDrawingBuffer.
Canvas reads back blank, so verifying a render (or producing stills) requires gl.readPixels immediately after an explicit scene.render().
Ask: a captureScreenshot() (or a preserveDrawingBuffer option).
10. Small-scale (mm) models aren't a supported case. Related to #2 — default near/far and radius limits assume large scenes. Every mm-scale consumer re-derives these. Ask: support/document a mm-scale mode.
Build & versioning
11. Three different builds are in the wild and they don't match.
adom-3d-viewer.min.js(the shipped bundle we consume) — oldest: greyclearColor+ skyboxprimaryColor0.75,environmentIntensity 1.5, opaque square ground.- The vendored
kyle/adom-3d-viewer-babylon9v0.2.0 source — newer, but still predates the current ground. - The live native build at
/static/vendor/adom-3d-viewer-babylon9/adom-3d-viewer-babylon9.esm.js?v=20260717e— newest: steel-blueclearColor#2a3340,environmentIntensity 1.0, no skybox mesh, and agroundFadeTexradial-fade (circular) ground.
Consumers who self-host the bundle therefore look visibly different from the native page viewer, and there's no way to tell which build you have. We only matched the native look by inspecting the live scene at runtime and hard-coding its values. Ask: one published, versioned bundle that downstream tools can pin, with the version discoverable at runtime.
Summary of what we'd most like, in priority order
(Letters are just the priority ranking; #N refers to the numbered items above.)
- a. Declarative custom Layers (#4)
- b. Storage-safe init (#1) and skybox-free
frameModel()(#2) - c. A single versioned published bundle (#11)
- d. Per-mesh hover tooltip API (#5)
- e. Ground state preserved across toggles (#3),
setBottomLight()(#6), shadow registration (#7) - f. Fuller
BABYLONsurface (#8), capture API (#9), mm-scale support (#10)
Happy to contribute patches for any of these — we have working local implementations of
#1 (storage shim), #2 (explicit mm-scale camera after frameModel()), #3 (re-applying
ground styling on toggle), #5 (hover tooltips built on scene.pick/multiPick, reusing your
tooltip styling), #6 (a synthesized bottom hemispheric light) and #7 (registering loaded
meshes as shadow casters/receivers).