Skip to content

Conversation

@seveibar
Copy link
Contributor

@seveibar seveibar commented Oct 1, 2025

No description provided.

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Comment on lines +98 to +101
// Calculate pad position relative to component center
const relativeX = pcbPad.x - component.center.x
const relativeY = pcbPad.y - component.center.y

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Transform pad offsets with the PCB matrix

Pad coordinates are computed in circuit-json space (relativeX/relativeY) and then written directly into FootprintPad.at. Because the PCB converter’s matrix in CircuitJsonToKicadPcbConverter applies a Y‑axis flip (scale of -1) and possible scaling, the footprint origin is transformed but the pads are not, so every pad is mirrored vertically and scaled incorrectly relative to its component center. Any non‑symmetric footprint will appear flipped on the generated PCB. Apply the same circuit‑to‑KiCad transform (or at least the Y inversion) to the pad offsets before assigning them.

Useful? React with 👍 / 👎.

Comment on lines +44 to +47
// Determine net number
let netNumber = 0
if (pcbNetMap && via.net_name) {
netNumber = pcbNetMap.get(via.net_name) ?? 0

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Via nets never match nets created in AddNetsStage

Vias look up their net number with pcbNetMap.get(via.net_name) but the only entries put into pcbNetMap come from AddNetsStage, which synthesises names like Net-${trace.pcb_trace_id} instead of the original net_name. Unless the JSON’s via net names happen to already be in that synthetic format, every via falls through to netNumber = 0, so all vias are exported as no‑net/GND regardless of the actual connectivity. The net map should be populated with the real circuit JSON net identifiers (and traces should reference those same names) before vias are added.

Useful? React with 👍 / 👎.

@seveibar seveibar merged commit 8dd0559 into main Oct 1, 2025
@seveibar seveibar deleted the pcb-support branch October 1, 2025 07:10
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