Expand description
Canonical KiCad 3D model pose math and HLR-to-board coordinate mapping.
Matches KiCad’s STEP exporter, Python KiCadFabView / fab/virtual/_assembly.py,
kicad_cruncher_pcb_model_pose.py, and pcbe typed_model_resources.rs.
Structs§
- FabBody3D
- One 3D model attachment extracted onto
crate::FabViewData.
Constants§
- BOARD_
MODEL_ Z_ OFFSET_ MM - Models sit this far above the board surface, as KiCad draws them.
Functions§
- flatten_
row_ major - Flatten a row-major 4x4 matrix into 16 scalars.
- identity
- local_
hlr_ mm_ to_ board_ nm - Map a Geometer local HLR point in millimetres (
+Yup camera) into+Y-up board nanometres. - local_
pose_ matrix - Compute a 3D model’s footprint-local 4x4 matrix on a board centred on
z = 0. - multiply
- normalize_
scale - Normalize zero or non-finite scales to
1.0(matching KiCad STEP export andpcbe). - rotation_
x - rotation_
y - rotation_
z - scale
- translation
- turned_
pose_ matrix - Compute
Rz(fp_angle_deg) * local_pose_matrix(...): the turned pose before XY placement.
Type Aliases§
- Matrix4
- Row-major 4x4 homogeneous transform matrix in millimetres.