Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions docs/elements/trace.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ Here's a simple example connecting two components:
| -------- | ----------- | ------- |
| `from` | Starting point of the trace using a [port selector](../guides/tscircuit-essentials/port-and-net-selectors.md) | `".R1 > .pin1"` |
| `to` | Ending point of the trace using a [port selector](../guides/tscircuit-essentials/port-and-net-selectors.md) | `".C1 > .pin1"` |
| `path` | Ports to connect, in order. The trace is routed as a chain from the first port to the last. | `[".J1 > .pin1", ".U1 > .pin1"]` |
| `name` | Names the trace and renders as the schematic net label for direct port-to-port traces (optional) | `"SENSE"` |
| `maxLength` | Maximum length the trace can be (optional) | `"10mm"` |
| `minLength` | Minimum length the trace must be (optional) | `"5mm"` |
Expand Down Expand Up @@ -91,6 +92,16 @@ Traces are automatically routed by tscircuit's [autorouting system](./board.mdx#

You can customize the autorouting behavior by setting the `autorouter` property on the parent [`<board />`](./board.mdx) or [`<subcircuit />`](./subcircuit.mdx).

## Ordered Paths

Use `path` to connect ports in the given order, as a chain:

```tsx
<trace path={[".J1 > .pin1", ".ESD > .pin1", ".U1 > .pin1"]} />
```

Entries like `net.GND` are also allowed and attach the trace to a net. `path` specifies which ports to connect and their order; the router still draws the copper. Use `pcbPath` to specify manual copper geometry.

## Manual PCB Paths

Sometimes you may want to manually specify the exact path a trace should take on the PCB. Provide a list of points with `pcbPath` to override autorouting and draw the route yourself. The coordinates are relative to a specific port defined by `pcbPathRelativeTo` (defaults to the `from` port). Entries in `pcbPath` can mix coordinate objects with [port selectors](../guides/tscircuit-essentials/port-and-net-selectors.md) so you can anchor the path to specific component pins.
Expand Down