Skip to content

Add pinLabelSide option to pinrow#672

Open
derekbreden wants to merge 2 commits into
tscircuit:mainfrom
derekbreden:add-flippinlabels-to-pinrow
Open

Add pinLabelSide option to pinrow#672
derekbreden wants to merge 2 commits into
tscircuit:mainfrom
derekbreden:add-flippinlabels-to-pinrow

Conversation

@derekbreden

@derekbreden derekbreden commented Jul 2, 2026

Copy link
Copy Markdown

What

Adds pinLabelSide to pinrow — 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's pinRowSide / pinrow<side> convention: pinlabeltop, pinlabelbottom, pinlabelleft, pinlabelright (e.g. pinrow5_pinlabelbottom), which resolve to the canonical pinLabelSide enum.

Behavior

pinLabelSide overrides the anchor side otherwise derived from text alignment / pinlabelorthogonal; unset → output unchanged. It's distinct from the layer option bottomsidepinlabel, and is scoped to the pin labels (ref-des unchanged).

  • pinrow5 (default) — labels above the row.
  • pinrow5_pinlabelbottom — labels below the row.

Tests

pinrow5_pinlabelbottom asserts the pinlabelbottom flag resolves to pinLabelSide: "bottom" and that a pin label lands on the opposite side vs the default, plus an SVG snapshot. bun test / build / biome all green.

Note

Supersedes the earlier flippinlabels approach per review — naming the absolute side rather than an axis-ambiguous inversion.

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.
@seveibar

seveibar commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

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).
@derekbreden derekbreden changed the title Add flippinlabels option to pinrow Add pinLabelSide option to pinrow Jul 2, 2026
@derekbreden

Copy link
Copy Markdown
Author

Good call — agreed on both counts (the inversion, and "flip" reading as a top/bottom layer op).

Dropped flippinlabels and replaced it with an explicit pinLabelSide ("top" | "bottom" | "left" | "right"), following the mountedpcbmodule pinRowSide / pinrow<side> convention already in the repo: string-form flags pinlabeltop / pinlabelbottom / pinlabelleft / pinlabelright resolve to the canonical enum (e.g. pinrow5_pinlabelbottom). It names the position directly (no inversion), and sits alongside the layer option bottomsidepinlabel the same way pinrowbottom does in mountedpcbmodule. Overrides the alignment-derived side; unset leaves output unchanged. PR + test/snapshot updated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants