Skip to content

sikit: glb importer for kicad-exported board geometry#145

Closed
UnsignedChad wants to merge 1 commit into
mainfrom
sikit/glb-import
Closed

sikit: glb importer for kicad-exported board geometry#145
UnsignedChad wants to merge 1 commit into
mainfrom
sikit/glb-import

Conversation

@UnsignedChad

Copy link
Copy Markdown
Owner

loads kicad-cli pcb export glb output into Mesh3D parts grouped by material, so the 3d canvas can draw kicads own board mesh and we keep the in-house mesher for analysis overlays only. removes the whole class of rotated-pad-pokes-out-sideways geometry bugs since kicads exporter already handles those cases.

handles node transforms (matrix + TRS, inverse-transpose on normals), u8/u16/u32 and non-indexed prims, interleaved buffers, missing normals (flat shaded), baseColorFactor materials, y-up to z-up remap.

vendors nlohmann/json 3.11.3 under third_party. test builds a synthetic two-material glb in memory and round-trips it, plus garbage/truncation rejection and the remap. also checked by hand against the khronos Box/BoxInterleaved/Duck samples.

verified the real path on this box: kicad-cli 9.0.8 exports tiny_pdn to a 62kb glb (glTF2, 42 prims, POSITION+NORMAL+u16 indices, 2 baseColorFactor mats), which is exactly what the loader eats.

prototype: nothing calls load_glb from the gui yet. SiTab/MpTab wiring is the follow-up.

718 tests pass.

Loads the output of 'kicad-cli pcb export glb' into Mesh3D parts grouped
by material, so the 3d canvas can draw KiCad's own board mesh and keep
in-house meshing for analysis overlays only. Handles node transforms,
u8/u16/u32 + non-indexed primitives, interleaved buffers, missing
normals (flat-shaded), baseColorFactor materials, y-up to z-up remap.
Vendors nlohmann/json 3.11.3 under third_party. Round-trip test builds
a synthetic two-material glb in memory; also verified against the
Khronos Box/BoxInterleaved/Duck samples.
@UnsignedChad

Copy link
Copy Markdown
Owner Author

landed on main directly as 982142c, closing

@UnsignedChad UnsignedChad deleted the sikit/glb-import branch June 9, 2026 22:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant