sikit: glb importer for kicad-exported board geometry#145
Closed
UnsignedChad wants to merge 1 commit into
Closed
Conversation
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.
Owner
Author
|
landed on main directly as 982142c, closing |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.