Adom Step2GLB - The Adom STEP Engine
Public Made by Adomby adom
The Adom STEP engine: fully manage STEP files. Convert to color-preserving GLB, render thumbnails and vector outlines, laser-etch MPNs, create and edit STEP geometry, extract features, and run molecule mode. One name for the thin Rust CLI and the shared OCCT service. Formerly 'step2glb' + 'service-step2glb'.
Board GLB: silkscreen written as a translucent BLEND material, so the mask hides it from some viewing angles
Problem
step2glb convert --molecule on a KiCad 10 board STEP (exported with --include-silkscreen --include-soldermask) writes three board-layer materials as alphaMode: BLEND:
| layer | baseColorFactor | alpha |
|---|---|---|
| silkscreen | 1, 1, 1 | 0.90 |
| solder mask | 0.08, 0.20, 0.14 | 0.83 |
| substrate | 0.42, 0.45, 0.29 | 0.98 |
three.js (the wiki's 3D viewer) sorts transparent meshes per object by camera distance, not per pixel. From some angles the translucent mask is drawn after the silkscreen, on top of it, and the silkscreen fades to a ghost; rotate a little and it is fully white again. John saw it on https://wiki.adom.inc/john/buck-12v5v-molecule ("it's like you're doing LOD or something").
Fix
Write the silkscreen and the substrate as OPAQUE (alpha 1) and keep only the solder mask BLEND. The opaque silkscreen writes depth, so the mask beneath it can never be drawn over it, from any angle; copper still shows through the mask. A near-opaque material (alpha >= 0.95) should never be emitted as BLEND anyway.
A post-process that does exactly this on the GLB's JSON chunk (no geometry change) is in the buck project: buck-12v5v-molecule/video/tools/fix_board_glb_alpha.py. The service should do it at write time so every board gets it.
0 Replies
Log in to reply.