---
name: step2glb
description: Convert STEP (.step/.stp) CAD files to color-preserving GLBs via the shared OCCT service — plain converts, geometric features, thumbnails, previews, and FULL MOLECULE MODE (--molecule/--board: MP-marker anchoring, gold machine pins, footprint + symbol JSON with per-pad wire-attach Z). Thin ~3MB Rust CLI; the 4.7GB OCCT runtime stays on the service. Use when the user asks to convert a STEP to GLB, convert a molecule board, render a component with real materials, extract STEP features, or make STEP thumbnails. Triggers: step to glb, step2glb, convert step, cad to glb, molecule convert, kicad step to glb, occt gltf, step preview, step thumbnail, step features.
---

# step2glb — STEP → GLB via the shared OCCT service

Thin Rust CLI (~3 MB, no CAD kernel) that shells to the shared OCCT XCAF
service. Returns `OK:`/`ERROR:` + `Hint:` lines so humans and agents both
parse results.

- **Install / update:** `adom-wiki pkg install adom/adom-step2glb`
- **Service:** `https://step2glb-gmdoncpxdwx0.adom.cloud` (the canonical shared
  instance; override with `STEP2GLB_SERVICE_API`). `step2glb health` checks it;
  `/health` exposes `git_sha_short` so you can see exactly what's deployed.
- Every request auto-sends the required `X-Client`/`X-Job-Name` identity
  headers. Large STEPs gzip on upload and queue async (the CLI polls for you).

## Plain conversion

```bash
step2glb convert part.step [-o part.glb]
step2glb from-library Package_TO_SOT_SMD/SOT-89-3   # fetch from service-kicad + convert
step2glb preview part.step                          # convert + open a Hydrogen webview to verify
```

Preserves per-face colors/materials (fixes the legacy all-white-GLB class of
bug). NOTE: if the output warns `molecule_markers_detected`, the STEP is a
molecule board — use molecule mode below instead; a plain GLB of a molecule
imports unanchored and unwireable.

## Molecule mode (boards with Adom machine pins)

```bash
step2glb convert board.step --board board.kicad_pcb --pin medium -o <slug>.glb
# --board implies --molecule; .brd (EAGLE/Fusion) boards work too
# optional: --silk-top top.png --silk-bottom bottom.png  (white art, transparent bg)
```

One command does the whole molecule pipeline server-side: MP-marker anchoring
(Z-up, front-left machine pin at origin, L4-L5 board-surface Z), canonical
gold machine-pin material, silkscreen overlay, meter normalization, Draco
optimization, and — with the board attached — **footprint + symbol JSON**
generation with per-pad wire-attach Z, downloaded beside the GLB as
`<stem>_footprint.json` / `<stem>_symbol.json`.

**Gate on the printed stats before publishing** (the molecule-publish skill
treats these as stop-signs):

| Stat | Expect | If not |
|---|---|---|
| `molecule_anchored` | `true` | MP1-MP4 markers missing from the STEP — fix the board/export |
| `pin_size` / `pin_size_source` | correct size, `markers` | size read from the marker names; `param` = fallback to `--pin` |
| `footprint_applied` + `footprint_pins` | `true`, 4 | board parse failed — read the warnings |
| `footprint_rebase` | absent or small | footprint re-based to the GLB's anchor pin (alignment guard) |
| `warnings` | none | every entry is actionable |

The final GLB carries `asset.extras.adomMolecule` (anchored, pin size, etc.) —
durable provenance you can check on any downloaded GLB. (Do NOT look for a
`molecule_anchor` node: the optimizer flattens it by design.)

## Other verbs

```bash
step2glb features part.step          # bbox, floor_z, longest axis, pin1 → JSON
step2glb thumbnail part.step         # PNG render (--width/--height/--pose)
step2glb thumbnail-batch part.step   # N orientations x M sizes in one call
step2glb config                      # show the service URL in effect
step2glb install                     # refresh this skill + bash completions
```

## Where this fits

`molecule-publish` (wiki publishing) and the EDA export skills
(`kicad-export-molecule`, `fusion-export-molecule`) drive this CLI as their
conversion stage. For pipeline-wide guidance start at the
`molecule-pipeline` page on the wiki.
