pcbPath coordinates are measured from the component's center, not from the anchor port as documented
Maintainers usually reply within 1 day
@OLuHneschastniy is already working on this.
Since Nov 13, 2026.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 50/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- typescript
- Domain
- embedded-iot
Research direction
Start by reading Trace_doInitialPcbManualTraceRender.ts at the transform call cited in the issue, then compare it with the PrimitiveComponent.ts transform implementation and the documented contract in trace.mdx. Reproduce the listed cases with tsci build or getTestFixture(); the work is done when the intended coordinate origin is resolved and the behavior and documentation agree.
Written by the indexing model from the issue text.
Description
What happens
The docs say pcbPath coordinates are relative to the from port (or to pcbPathRelativeTo). In practice, { x, y } points are placed relative to the center of the component that owns that port, and they rotate with the component.
Reproduction
pcbpath.circuit.tsx:
export default () => (
<board width="20mm" height="10mm">
<resistor name="R1" resistance="10k" footprint="0402" pcbX={-3} />
<resistor name="R2" resistance="10k" footprint="0402" pcbX={3} />
<trace name="T1" from="R1.pin2" to="R2.pin1" pcbPath={[{ x: 0, y: 2 }]} />
</board>
)
tsci build pcbpath.circuit.tsx --disable-parts-engine
Expected
R1.pin2 is at (-2.49, 0), so the path point should be at (-2.49, 2).
Actual
The point is at (-3, 2), which is R1's center plus (0, 2). pcb_trace.route in circuit.json:
(-2.49, 0) -> (-3, 2) -> (2.49, 0)
With pcbRotation={90} on R1 (R1.pin2 is then at (-3, 0.51)), the same pcbPath gives:
(-3, 0.51) -> (-5, 0) -> (2.49, 0)
(-5, 0) is R1's center plus (0, 2) rotated by 90 degrees.
The example in the docs behaves the same way. With
<trace
from="R1.pin2"
to="R2.pin1"
pcbPathRelativeTo="R1.pin2"
pcbPath={["R1.pin2", { x: 0, y: 4 }, "R2.pin1"]}
/>
the { x: 0, y: 4 } point ends up at (-3, 4), not (-2.49, 4).
Versions
tscircuit 0.0.3161 (@tscircuit/cli 0.1.2454, @tscircuit/core 0.0.2343), Bun 1.4.4, Linux.
Also on core main (8bb3fef, v0.0.2346), rendering the same three boards with getTestFixture() gives the same routes.
Cause
Docs ("The coordinates are relative to a specific port defined by pcbPathRelativeTo (defaults to the from port)"):
https://github.com/tscircuit/docs/blob/ab0abf51963ab9f1fd28d0b67eb1393d7d30d855/docs/elements/trace.mdx?plain=1#L96
Core transforms the points with anchorPort._computePcbGlobalTransformBeforeLayout():
https://github.com/tscircuit/core/blob/8bb3fefe5f273b9d5ab15a2f33e5aaf1f90b5865/lib/components/primitive-components/Trace/Trace_doInitialPcbManualTraceRender.ts#L389-L391
A port has no pcbX/pcbY of its own, so as far as I can see this is the parent component's transform (position and rotation), not the pad position:
https://github.com/tscircuit/core/blob/8bb3fefe5f273b9d5ab15a2f33e5aaf1f90b5865/lib/components/base-components/PrimitiveComponent/PrimitiveComponent.ts#L517-L556
Question
Which one is intended? If the component frame is intended, the docs could say "relative to the component that owns the port". If the port is intended, the origin is off by the pad offset.
AI-assisted: I used Claude Code to read the source, run the reproduction above and draft this report.
- Dominant language
- TypeScript
- Stars
- 61
- Forks
- 256
- Avg merge
- 20h 21m
- Merged PRs (30d)
- 289
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from tscircuit/core
-
Standalone `import("@tscircuit/core")` fails with `ERR_MODULE_NOT_FOUND` due to `devDependencies`-only imports in `dist/`Possibly taken @Andresdev14 claimed this 1 day ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
tscircuit/core#5508 · 1 comment ·
Maintainers usually reply within 1 day
-
Default solder paste aperture is 0.7x the pad (49% of its area)Possibly taken @zainrizvi0611-cmd claimed this 16 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
tscircuit/core#4800 · 1 comment ·
Maintainers usually reply within 1 day
-
SCHEMATIC_COMPONENT_OUTLINE_COLOR "rgba(132, 0, 0)" is not portable SVG color; strict SVG renderers reject schematic outputPossibly taken @zainrizvi0611-cmd claimed this 17 days ago. Open
Difficulty 1/5 Under an hour Newbie friendliness 92/100
Maintainers usually reply within 1 day
-
Scientific notation is truncated in simulation graph scale and offset settingsPossibly taken @Crodify claimed this 9 days ago. Openno-issue-activity
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
tscircuit/core#3732 · 1 comment ·
Maintainers usually reply within 1 day
-
SchematicRect drops fillColor from circuit JSON and renders filled rectangles with the stroke colorPossibly taken @cocvn157 claimed this 11 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
Similar issues
-
clawsweeper:fix-shape-clear clawsweeper:queueable-fix clawsweeper:source-repro impact:ux-friction issue-rating: 🦞 diamond lobster no-stale P2
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
openclaw/openclaw#199885 · 2 comments · 1 reaction ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
feature needs-triage
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
BoardGamesEmpire/board-games-empire-backend#1306 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 80/100
sequant-io/sequant#1689 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 80/100