Add pinLabelSide option to pinrow#672
Conversation
Adds an opt-in `flippinlabels` boolean to the pinrow footprint that places the pin labels and the ref-des on the opposite side of the pin row. It flips the effective anchor side for both the label position and its text alignment, and mirrors the ref-des to the far side. Non-breaking — defaults to false, so existing output is unchanged. Useful when the default label side collides with adjacent silk/copper or when a board reads better with pin labels on the other edge. Adds a pinrow5_flippinlabels snapshot test that also asserts the ref-des lands on the opposite side vs the default pinrow5.
|
Generally we try not to specify things with inversions, flip is sort of axis-ambiguous. Can you think of a way to specify this position where the behavior is more obvious? Eg flip often refers to top/bottom LAYER |
…flippinlabels
Addresses review feedback: avoid the relative, axis-ambiguous `flippinlabels`
boolean ("flip" also reads as a top/bottom LAYER operation). Instead specify the
position directly, following footprinter's own mountedpcbmodule convention — a
`pinLabelSide` enum ("top" | "bottom" | "left" | "right") plus string-form flags
(pinlabeltop / pinlabelbottom / pinlabelleft / pinlabelright) that resolve to it.
It overrides the anchor side otherwise derived from text alignment / orthogonal;
unset leaves output unchanged. Scoped to the pin labels only (ref-des unchanged),
so the behavior is obvious. Test + snapshot updated (pinrow5_pinlabelbottom).
|
Good call — agreed on both counts (the inversion, and "flip" reading as a top/bottom layer op). Dropped |
What
Adds
pinLabelSidetopinrow— specify which side of the pin row the pin labels sit on:"top" | "bottom" | "left" | "right".In the string DSL it's set via flags mirroring
mountedpcbmodule'spinRowSide/pinrow<side>convention:pinlabeltop,pinlabelbottom,pinlabelleft,pinlabelright(e.g.pinrow5_pinlabelbottom), which resolve to the canonicalpinLabelSideenum.Behavior
pinLabelSideoverrides the anchor side otherwise derived from text alignment /pinlabelorthogonal; unset → output unchanged. It's distinct from the layer optionbottomsidepinlabel, and is scoped to the pin labels (ref-des unchanged).pinrow5(default) — labels above the row.pinrow5_pinlabelbottom— labels below the row.Tests
pinrow5_pinlabelbottomasserts thepinlabelbottomflag resolves topinLabelSide: "bottom"and that a pin label lands on the opposite side vs the default, plus an SVG snapshot.bun test/build/biomeall green.Note
Supersedes the earlier
flippinlabelsapproach per review — naming the absolute side rather than an axis-ambiguous inversion.