# adom-step — STEP file viewer

A Fusion 360-style viewer for STEP (`.step` / `.stp`) files inside a
Hydrogen webview. Renders on the canonical Adom Babylon9 viewer.

## What it does

- **Components outline** — left-sidebar tree of every assembly node in
  the STEP. Per-row eye-toggle (tri-state across subtrees), isolate,
  zoom-to, search, right-click context menu.
- **Smart-pick measure** — Fusion-style snap to vertex / edge / face /
  body. Two clicks → distance in mm and mils, plus ΔX / ΔY / ΔZ and
  the angle between picks. Multi-stage Esc to back off one click at
  a time.
- **Hover-inspect HUD** — name, breadcrumb path, bbox W×D×H, material
  swatch, vertex/face count.
- **Pin / contact detection** — two-mode clusterer that walks the
  scene graph, groups meshes by inferred material role (body / pin /
  contact / marker), and surfaces detected pins as individual outline
  rows. Handles SOIC / QFP / QFN (per-side 1D), LGA / BGA / aQFN
  (2D bimodal-gap union-find), and through-hole connectors (geometry-
  based: tall-thin sub-meshes poking below the body's seating plane,
  regardless of material color).
- **Strobe** — flash each detected pin once at a configurable interval.
  Auto-disables with an explanatory tooltip on STEPs where no pins or
  contacts were found.
- **Right-click anywhere in the canvas** — Reveal in Components Outline,
  Isolate, Hide Others, Show, Hide, Zoom To, Copy Name, Properties.
  All visibility actions are Ctrl+Z / Ctrl+Y undoable; "Hide" auto-
  flashes the row in the outline so you can find the hidden item again.
- **Babylon Inspector** — bundled (not CDN), one click opens the full
  scene-graph debugger.
- **CLI mirrors every UI verb** — drive the running viewer from the
  shell or from Claude.

## Install

```bash
curl -fsSL https://wiki-ufypy5dpx93o.adom.cloud/static/apps/adom-step/adom-step -o /tmp/adom-step \
  && chmod +x /tmp/adom-step \
  && sudo install -m 0755 /tmp/adom-step /usr/local/bin/adom-step \
  && adom-step install
```

`adom-step install` deploys SKILL.md + completions to `~/.claude/skills/`
and `~/.local/`.

## Quick start

```bash
# Open any STEP file:
adom-step view /path/to/design.step

# Open a KiCad library footprint by canonical name:
adom-step view-library Package_QFP/LQFP-64_10x10mm_P0.5mm

# Drive from the CLI / from Claude:
adom-step list-components               # tree dump
adom-step isolate U1                    # hide others + frame
adom-step show NAME / hide NAME / show-all
adom-step measure A B                   # mm + mils
adom-step pins list                     # detected clusters
adom-step pins isolate 3
adom-step pins strobe                   # flash each pin
adom-step view-cube iso                 # front | top | iso | home | ...
adom-step screenshot --out /tmp/x.png
adom-step eval "return Object.keys(window.adomStep)"
adom-step console -f                    # tail webview console
```

## Pipeline

```
.step  →  service-step2glb /convert  →  GLB (hierarchy + materials preserved)
       →  /tmp/adom-step-cache/<sha256>.glb
       →  Babylon SceneLoader.ImportMeshAsync
       →  scene.transformNodes  →  components outline
```

The conversion side uses OCCT XCAF + `RWGltf_CafWriter`, which preserves
the STEP product structure and per-face materials end-to-end. That's
why TI / Renesas / Nordic STEPs surface their named pin hierarchy
directly (no client-side STEP parsing).

## See also

- [`service-step2glb`](https://wiki-ufypy5dpx93o.adom.cloud/services/service-step2glb)
  — the OCCT-based converter that produces the GLBs.
- [`adom-3d-viewer-babylon9`](https://wiki-ufypy5dpx93o.adom.cloud/apps/adom-3d-viewer-babylon9)
  — the canonical Babylon9 viewer adom-step renders into.
- [`chip-fetcher`](https://wiki-ufypy5dpx93o.adom.cloud/apps/chip-fetcher)
  — source of the manufacturer STEPs adom-step is tuned for.
