target.model anchor. It uses the same Pinbox store, events, CLI,
MCP tools, replies, resolution, and agent delivery as other pins. kind still
expresses intent (note, comment, or move); the target expresses where.
Existing DOM and source pins keep their current format.
Create a 3D pin with the CLI
data.target.model contains the anchor. Read it back with pinbox show <id> --json.
Use --comment for an annotation that should not wake an agent.
Coordinates must be finite. The CLI and core schema reject malformed anchors.
Pinbox stores anchor data; it does not load or validate CAD/mesh files.
Use Pinbox’s toolbar and cards in a 3D viewer
pick returns a ModelAnchor or null; project returns viewport
CSS pixels {x,y} or null for hidden, stale, or occluded points.
For a host-owned backend that calls the CLI, mount the exported PinboxToolbarElement
without hub attributes and wire its public store and actions to the backend.
The backend must authenticate requests and stamp their authors. Standard hub users
should prefer Pinbox.init above.
Optional interaction hooks
onHover(anchor | null)runs on eachupdate()while pointing at the surface in pin mode. Use it to color the picked part; restore its material onnull. Leaving the surface, exiting pin mode, window blur, and disposal clear the hover.onActivate(anchor, pin, { signal })handles marker/inbox selection. Useawait modelUi.openPin(pinId)for host sidebar links, including reopening the same pin. The previous signal is aborted on another selection, dismissal or disposal; honor it when loading geometry or moving the camera.acceptsAnchorroutes pins to the right viewer on pages with multiple models. Omit it for a single viewer.onCapture()replaces the camera action for this toolbar, including its button, puck and S shortcut. It does not request screen-sharing permission or switch the saved DOM/tab preference. With multiple viewers the first registered capture hook is the default; entering or pressing another surface makes it the capture owner. Destroying that viewer restores another registered owner, or the normal 2D toggle. Repeated capture actions are ignored until its returned promise settles.onError(error)receives activation/capture failures and hover picking failures. Without it failures are logged to the console.
Pinbox.init.
Implement picking and projection
The@autono/pinbox-toolbar/model export works with Three.js, Babylon.js, CAD
viewers, or a custom renderer. It has no renderer runtime dependency.
- Raycast a pointer click against the model.
- Convert the hit from world coordinates to the picked part’s local coordinates.
- Create a Pinbox pin with
target.model, through your authenticated backend. - Resolve the anchor against the part’s current transform each animation frame.
- Project the resulting world point to screen coordinates and apply your viewer’s visibility/occlusion checks.
visible means the anchor resolved; the host must still check camera clipping,
hidden parts, and occlusion before drawing a marker. Pinbox’s default DOM toolbar
does not raycast a canvas automatically; the host supplies the 3D interaction.
A different model or revision returns stale; a missing part or unusable matrix
returns missing. Show the original revision or explicitly migrate the pin after
checking the new geometry. Do not silently reuse triangle indices across revisions.
Attribute requests from a signed-in app
A trusted local backend may use--author-json:
pinbox verify <id> --outcome accepted --json and
pinbox verify <id> --outcome reopened --json. Replies and resolutions continue
through pinbox reply and pinbox resolve.