← Commit history

Initial commit: app/adom-step2glb

John Lauer ·6d386bba05 ·4mo ago
2 files changed +91
README.mdadded+62
@@ -0,0 +1,62 @@+# adom-step2glb++Thin CLI for STEP → GLB conversion with color preservation. Forwards requests to the shared **service-step2glb** container so individual containers don't need to ship the ~1.1 GB OCCT runtime.++> **Renamed:** this app was formerly published as `step2glb`. It's now `adom-step2glb` (binary `adom-step2glb`), using the v1.2 async job protocol against the shared service. A `step2glb` binary alias is kept for back-compat — existing scripts that call `step2glb …` keep working.++![step2glb preview — LQFP-100 converted from STEP with colors preserved + ground plane + cast shadow](docs/screenshots/01-iso-lqfp100.png)++## What it does++```+step2glb convert SOT-89-3.step -o SOT-89-3.glb+step2glb from-library Package_TO_SOT_SMD/SOT-89-3+step2glb preview Package_QFP/LQFP-100_14x14mm_P0.5mm      # opens a Hydrogen webview+```++All three pass through to `service-step2glb`, which:+1. Reads STEP via OCCT's `STEPCAFControl_Reader` with colors, names, and materials enabled.+2. Tessellates with `BRepMesh_IncrementalMesh`.+3. Writes glTF with `RWGltf_CafWriter` — the XCAF path that **preserves per-face colors** from the source CAD (unlike `cadquery.Assembly.save('…glTF')` or `kicad-cli pcb export glb`, which both collapse to all-white).++The CLI follows adom-cli-design: `OK:` / `ERROR:` / `Hint:` on the first line, then a JSON companion line so AI callers can parse the result structurally.++## The preview webview++`step2glb preview <source>` opens a Hydrogen tab with a Babylon scene tuned per the `3d-viewer-design` skill: brightened gradient bg, medium-gray transparent ground with real cast shadows, depth-tested world-origin gizmo, screen-space corner triad with X/Y/Z labels, Shift+Alt+Click orbit recentering, adaptive camera precision.++### Materials preserved from the STEP file++The drawer lists every material extracted by OCCT's XCAF pipeline with a live color swatch and RGB values. This is the thing that was missing in the legacy `kicad-cli pcb export glb` path.++![Materials drawer open showing per-material color swatches extracted from the STEP](docs/screenshots/02-materials-drawer.png)++### Bottom view works through a 65%-transparent ground++Per the `3d-viewer-design` §4d ground rule, the ground plane is alpha 0.35 so the chip's bottom face stays visible through it — critical for "is the chip seated on pads or floating above?"++![Bottom view — chip visible through the 65%-transparent ground plane](docs/screenshots/03-bottom-transparent-ground.png)++### Regenerates the 3 broken wiki 3dcomp chips++`Package_TO_SOT_SMD/SOT-89-3` was one of three wiki 3dcomps whose GLBs had no chip body — just the baked PCB demo — because the legacy kicad-cli GLB export stripped the body. step2glb regenerates it cleanly:++![SOT-89-3 iso view — clean conversion with ground + shadow](docs/screenshots/04-iso-sot-89-3.png)++## Install (Tier B, from the wiki)++See `SKILL.md` for the one-liner. No venv, no Python, no OCCT on the local container — just a 3 MB binary.++## Related repos++- **adom-inc/service-step2glb** — the shared-service container this CLI talks to. Owns the Python helper, OCCT venv, and watchdog.+- **adom-inc/service-kicad** — supplies STEP files (+ all other KiCad library content) to `from-library` calls.++## Local development++```+./build.sh            # cargo build --release + install to /usr/local/bin+./tests/ralph.sh      # 5-package conversion smoke test; pass criteria: meshes>=1, materials>=1, sizeBytes>1000+```++The `preview` subcommand still spawns a local `tiny_http` — Hydrogen webviews can't reach the external service URL directly, so the GLB is fetched once from the service and re-served on the user's container-proxy port for the webview.
page.jsonadded+29
@@ -0,0 +1,29 @@+{+  "slug": "adom-step2glb",+  "version": "1.0.0",+  "type": "app",+  "description": "Color-preserving STEP (.step/.stp) to GLB converter. Thin Rust CLI shelling to a shared OCCT XCAF service. Formerly 'step2glb'.",+  "tags": [+    "step",+    "glb",+    "cad",+    "converter",+    "occt",+    "3d"+  ],+  "hero": {+    "type": "image",+    "path": "adom-step2glb-billboard.png"+  },+  "dependencies": {},+  "scripts": {+    "install": "./install.sh",+    "uninstall": "./uninstall.sh"+  },+  "license": "MIT",+  "org": "adom",+  "author": {+    "name": "John Lauer",+    "email": "[email protected]"+  }+}\ No newline at end of file