Expand description
Canonical source-neutral assembly-designator fitting shared by FabView
virtual layers (ASSEMBLY_DESIGNATORS_*) and kcr pcb-svg / toon.
Matches pcbe’s primary assembly.rs fitter: hole-preserving MultiPolygon
containment, deterministic multi-center candidate search (centroid, interior
point, bbox center, per-part centers, 3x3 interior grid), 12-step binary
search, and an explicit horizontal (0 deg) tie-breaker on equal/square fits.
Structs§
- Designator
Fit - One fitted component designator placement in millimetres (
+Yup or canvas space). - Designator
FitSession - Relative-fit memoization session for fitting designators across a board.
Constants§
- DEFAULT_
OBLIQUE_ MIN_ ASPECT_ RATIO - Minimum component aspect ratio (
long / short) required before an oblique component (e.g.45 deg) rotates its designator off horizontal/orthogonal.
Functions§
- normalize_
designator_ axis - Normalize an orientation angle into
[-90, 90)degrees. - pad_
envelope - Convex hull envelope over a component’s pad polygons.
- region_
from_ evenodd_ layers - Combine already-closed projected rings with SVG’s even-odd rule per layer, then union the visible layers into one annotation region.
- ring_
polygon - Build a valid positive-area polygon from a ring of 2D mm coordinates.
- subtract_
cutouts - Subtract board cutouts from an annotation region so labels never sit over empty air.