Skip to content
Draft
Show file tree
Hide file tree
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
14 changes: 14 additions & 0 deletions codetestingplayground/trace-teardrops.circuit.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
export default () => (
<board width="16mm" height="10mm">
<resistor name="R1" resistance="100" footprint="0603" pcbX={-3} />
<capacitor name="C1" capacitance="10nF" footprint="0603" pcbX={3} />
<trace
from="R1.2"
to="C1.1"
thickness="0.2mm"
pcbPath={[]}
pcbTeardrops
pcbTeardropEnd={false}
/>
</board>
)
28 changes: 28 additions & 0 deletions docs/elements/trace.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,36 @@ Here's a simple example connecting two components:
| `width` | Width of the trace (optional) | `"0.2mm"` |
| `thickness` | Same as `width`; sets the copper width for the trace (optional) | `"0.2mm"` |
| `pcbPath` | Array of points defining a manual PCB path relative to an anchor port | `[{ x: 1, y: 0 }, { x: 1, y: 1 }]` |
| `pcbTeardrops` | Enable automatic PCB teardrops | `true` |
| `pcbTeardropStart` | Teardrop at the start (from) of trace | `true` |
| `pcbTeardropEnd` | Teardrop at the end (to) of trace | `false` |
| `pcbPathRelativeTo` | Port selector that `pcbPath` coordinates are relative to (defaults to the `from` port) | `".R1 > .pin2"` |

## PCB teardrops

Set `pcbTeardrops` to widen traces at pad and via contacts after routing.
Use `pcbTeardropStart` and `pcbTeardropEnd` to override the `from` and `to`
endpoints. Omitted endpoint settings inherit `pcbTeardrops`.

This example adds a teardrop at R1 while leaving the C1 end unchanged:

<CircuitPreview defaultView="pcb" code={`
export default () => (
<board width="16mm" height="10mm">
<resistor name="R1" resistance="100" footprint="0603" pcbX={-3} />
<capacitor name="C1" capacitance="10nF" footprint="0603" pcbX={3} />
<trace
from="R1.2"
to="C1.1"
thickness="0.2mm"
pcbPath={[]}
pcbTeardrops
pcbTeardropEnd={false}
/>
</board>
)
`} />

## Connecting to Nets

Traces can connect to named nets like power and ground:
Expand Down
Loading