Skip to main content

Module part_mount

Module part_mount 

Source
Expand description

A part’s mount frame: how it sits on its footprint, applied to every instance (see part_mount.rs). A part’s MOUNT FRAME: how the part sits on its footprint, kept beside its features rather than in them.

The part document’s top-level mount block is a rigid pose in the shape an ACOMP transform takes, {translate (mm), rotateEulerDeg (intrinsic XYZ)}. It maps the part’s model coordinates to its footprint’s: p_footprint = M · p_model. The footprint frame is the board’s: top copper at z = 0, millimetres with y up.

The mount always moves the WHOLE part (every solid, every connection point and its seat). Nothing selects what it applies to. It is applied in ONE place: the ACOMP feature poses an instance’s members, ports and nested poses by M before the instance pose. So a part has one frame wherever it is placed, and the instance’s own pose is still exactly the one it was given. The solver writes that pose back, so it must never carry M.

No block means identity. An identity mount is never written (mount_block_of says None for it), so a part with no mount and every KiCad import stay byte-identical.

Structs§

AlignPad
One pad for mount_aligned_to_footprint: its number and centre in the footprint frame (mm, y up), and whether it is surface mount (no drill).
AlignReport
What Align to footprint did: the new mount, the leftover, and what it wants said (a rotation it kept, a height it could not set, a mirror).
AlignSeat
One seated pcb point for mount_aligned_to_footprint, in MODEL coordinates as the part builds it.

Constants§

MOUNT_BLOCK
The part document’s top-level key for its mount frame.

Functions§

is_identity
Whether transform is the identity, to IDENTITY_TOLERANCE (1e-6).
mount_aligned_to_footprint
Align to footprint: the mount current (identity when None) refitted so the part’s seats land on their pads, as one rigid move, with the leftover.
mount_block_of
The mount block to store for transform: None for identity (the key is then removed, never written as a default), otherwise the pose in the shape part_mount reads back.
mount_from_block
Read one mount block as the rigid pose it is.
mount_origin_to
The mount current (identity when None) moved IN THE FOOTPRINT’S PLANE so that point (model coordinates) lands on the footprint origin. Its height is left alone: that is the seating plane’s to say.
mount_seated_on
The mount current (identity when None) turned and lifted so the plane through origin with OUTWARD normal normal (both model coordinates) is the seating plane: the normal points down (−z) and the plane is at z = 0.
part_mount
The mount frame document declares, None when it has none.
reference_plane
The plane a picked name stands for, against the scene prefix builds: (origin, outward unit normal). A PLANAR face gives its own plane, its normal pointing out of the material; a datum plane gives its frame’s z. Anything else is refused by name: a seating plane must be a plane.