From 0410ba014567b0b6711ec7b15f828f62ac002f11 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?0hm=E2=98=98=EF=B8=8F?= Date: Thu, 16 Jul 2026 01:00:55 +0530 Subject: [PATCH 1/6] Fix differential pair routing example --- docs/elements/trace.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/elements/trace.mdx b/docs/elements/trace.mdx index 4ab9ab2..9436631 100644 --- a/docs/elements/trace.mdx +++ b/docs/elements/trace.mdx @@ -154,7 +154,7 @@ refer to the traces by `name` or by a specific pin selector. ) From ab5044868a67c48fedaa5791a7db7f440ee2dbc3 Mon Sep 17 00:00:00 2001 From: Manish chaudhary <125847751+techmannih@users.noreply.github.com> Date: Thu, 16 Jul 2026 10:52:45 +0530 Subject: [PATCH 2/6] docs: document direct .kicad_sym imports (#795) * docs: document direct .kicad_sym imports * Update importing-from-kicad.md * Update importing-from-kicad.md * merge --- .../importing-from-kicad.md | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/docs/guides/importing-modules-and-chips/importing-from-kicad.md b/docs/guides/importing-modules-and-chips/importing-from-kicad.md index e1665fb..ac3f803 100644 --- a/docs/guides/importing-modules-and-chips/importing-from-kicad.md +++ b/docs/guides/importing-modules-and-chips/importing-from-kicad.md @@ -72,18 +72,23 @@ circuit.add( bun add kicad-component-converter ``` -#### Import `.kicad_mod` files directly +#### Import `.kicad_mod` and `.kicad_sym` files directly `kicad-component-converter` registers a bundler loader that lets you import KiCad -footprints like any other module inside your tscircuit project: +footprints and symbols like any other modules inside your tscircuit project: ```tsx +import kicadSym from "./symbol.kicad_sym" import kicadMod from "./footprint.kicad_mod" export default () => { return ( - + ) } From e4e820e46087fad1a946df6aed16bb1a0b22bfd4 Mon Sep 17 00:00:00 2001 From: Manish chaudhary <125847751+techmannih@users.noreply.github.com> Date: Fri, 17 Jul 2026 05:13:45 +0530 Subject: [PATCH 3/6] Add guide for importing Ultra Librarian (#800) --- .../importing-from-ultra-librarian.md | 51 +++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 docs/guides/importing-modules-and-chips/importing-from-ultra-librarian.md diff --git a/docs/guides/importing-modules-and-chips/importing-from-ultra-librarian.md b/docs/guides/importing-modules-and-chips/importing-from-ultra-librarian.md new file mode 100644 index 0000000..f9fe4a6 --- /dev/null +++ b/docs/guides/importing-modules-and-chips/importing-from-ultra-librarian.md @@ -0,0 +1,51 @@ +--- +title: Importing from Ultra Librarian +sidebar_position: 3.5 +description: Download a KiCad symbol and footprint from Ultra Librarian and import them directly into tscircuit. +--- + +## Overview + +You can download schematic symbols and PCB footprints from +[Ultra Librarian](https://www.ultralibrarian.com/) and import the KiCad files +directly into tscircuit. + +## Downloading from Ultra Librarian + +1. Visit [Ultra Librarian](https://www.ultralibrarian.com/). +2. Search for the manufacturer part number. +3. Select the footprint variant you need. +4. Click **Download Now**. +5. Sign in or create an Ultra Librarian account when prompted. +6. Choose the **KiCad v5** or **KiCad v6+** format. +7. Download and extract the ZIP file. + +The extracted files include: + +- the `.kicad_mod` file for the PCB footprint +- the `.kicad_sym` file for the schematic symbol + +## Importing Ultra Librarian Components + +Copy both files into your tscircuit project. Import them and pass them to the +`footprint` and `symbol` props of a ``: + +```tsx +import kicadSym from "./symbol.kicad_sym" +import kicadMod from "./footprint.kicad_mod" + +export default () => { + return ( + + + + ) +} +``` + +The `.kicad_mod` file provides the PCB footprint, while the `.kicad_sym` file +provides the schematic symbol. From 3df5a865953f6f9c2d2e3d52afbd60d47151d821 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?0hm=E2=98=98=EF=B8=8F?= Date: Sat, 18 Jul 2026 00:35:43 +0530 Subject: [PATCH 4/6] Expand differential pair documentation --- docs/elements/differential-pair.mdx | 104 +++++++++++++++++++--------- docs/elements/trace.mdx | 7 +- 2 files changed, 76 insertions(+), 35 deletions(-) diff --git a/docs/elements/differential-pair.mdx b/docs/elements/differential-pair.mdx index 95d0fdd..8f5e05a 100644 --- a/docs/elements/differential-pair.mdx +++ b/docs/elements/differential-pair.mdx @@ -20,43 +20,30 @@ differential impedance, trace width, pair spacing, or parallel routing. ## Quick start with trace names -Use trace names when the same circuit creates the traces and the constraint. Give each `` a unique `name`, then reference those names from ``. ( - - - + + + @@ -65,31 +52,84 @@ Give each `` a unique `name`, then reference those names from In this example: -- `usb_dp` and `usb_dm` create the electrical connections. +- `USB_P` and `USB_N` create the electrical connections. - `` groups those connections for length matching. - `maxLengthSkew={0.05}` allows an absolute routed-length difference of up to 0.05 mm. +Core passes `maxLengthSkew` to the autorouter as the pair's `lengthTolerance`. +The constraint is satisfied when: + +```text +abs(positiveRouteLength - negativeRouteLength) <= lengthTolerance +``` + +The routed lengths and `lengthTolerance` are measured in millimeters. +`maxLengthSkew` is an absolute length difference, not a ratio or percentage. + Supported autorouters try to add length, often as a meander, to the shorter -route. Routing can fail when there is no valid segment or enough room to meet -the tolerance. +route. Routing can fail when there is no suitable straight segment or +insufficient room to meet the tolerance. + +## Quick start with pin selectors + +Use pin selectors when you want the pair declaration to identify each trace by +a pin it connects to. Each selector must resolve to one pin that belongs to +exactly one trace. Pins are ports in tscircuit, so `.U1 > .pin1` is a port +selector for a specific pin. + + ( + + + + + + + + + + ) +`} /> + +Only one pin from each trace is needed. Here, `.U1 > .pin1` and +`.U1 > .pin2` resolve to the two existing traces. A component selector such as +`.U1` is not enough; select a specific pin. ## Choosing trace names or pin selectors | Use | When to choose it | Example | | --- | --- | --- | -| Trace name | The same circuit defines and names the traces. | `positiveConnection="usb_dp"` | -| Pin selector | A reusable component knows its differential pins, while its parent creates the traces. | `positiveConnection=".USBC > .DP1"` | +| Trace name | The trace has a unique `name`. | `positiveConnection="USB_P"` | +| Pin selector | The selected pin connects to exactly one trace. | `positiveConnection=".U1 > .pin1"` | You may use a trace name for one connection and a pin selector for the other. Each value must ultimately resolve to exactly one trace in the same board or autorouted subcircuit. +If a selected pin connects to multiple `` elements, use a trace name +to avoid an ambiguous match. When using +[phased autorouting](./autoroutingphase.mdx), give both traces the same +`routingPhaseIndex`. + ## Properties | Property | Type | Description | | --- | --- | --- | | `name` | `string` | Optional name for the differential pair. | -| `positiveConnection` | `string` | Exact positive trace name or pin/port selector. | -| `negativeConnection` | `string` | Exact negative trace name or pin/port selector. | -| `maxLengthSkew` | `number` | Maximum absolute difference between the routed lengths, in millimeters. Accepts `0` through `1`; defaults to `0.1` mm. | +| `positiveConnection` | `string` | Exact positive trace name or port selector. | +| `negativeConnection` | `string` | Exact negative trace name or port selector. | +| `maxLengthSkew` | `number` | Maximum absolute difference between the routed lengths, in millimeters—not a ratio. Accepts any non-negative distance and defaults to `0.1` mm. | diff --git a/docs/elements/trace.mdx b/docs/elements/trace.mdx index 9436631..eb33405 100644 --- a/docs/elements/trace.mdx +++ b/docs/elements/trace.mdx @@ -162,9 +162,10 @@ refer to the traces by `name` or by a specific pin selector. The constraint is passed to the autorouter. Supported autorouters try to add length to the shorter route until the absolute difference is at most -`maxLengthSkew`. This only constrains routed length; it does not set pair -spacing or differential impedance. See the dedicated page for pin selectors, -reusable connector components, and troubleshooting. +`maxLengthSkew`. The routed lengths and tolerance are measured in millimeters, +not as a ratio. This only constrains routed length; it does not set pair spacing +or differential impedance. See the dedicated page for complete trace-name and +pin-selector examples. ## Net vs Direct connections From 3bbffd28e3966ec93f84644802fd09918e354608 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?0hm=E2=98=98=EF=B8=8F?= Date: Sat, 18 Jul 2026 00:41:15 +0530 Subject: [PATCH 5/6] Keep differential pair docs user focused --- docs/elements/differential-pair.mdx | 14 -------------- docs/elements/trace.mdx | 9 +++------ 2 files changed, 3 insertions(+), 20 deletions(-) diff --git a/docs/elements/differential-pair.mdx b/docs/elements/differential-pair.mdx index 8f5e05a..1843300 100644 --- a/docs/elements/differential-pair.mdx +++ b/docs/elements/differential-pair.mdx @@ -57,20 +57,6 @@ In this example: - `maxLengthSkew={0.05}` allows an absolute routed-length difference of up to 0.05 mm. -Core passes `maxLengthSkew` to the autorouter as the pair's `lengthTolerance`. -The constraint is satisfied when: - -```text -abs(positiveRouteLength - negativeRouteLength) <= lengthTolerance -``` - -The routed lengths and `lengthTolerance` are measured in millimeters. -`maxLengthSkew` is an absolute length difference, not a ratio or percentage. - -Supported autorouters try to add length, often as a meander, to the shorter -route. Routing can fail when there is no suitable straight segment or -insufficient room to meet the tolerance. - ## Quick start with pin selectors Use pin selectors when you want the pair declaration to identify each trace by diff --git a/docs/elements/trace.mdx b/docs/elements/trace.mdx index eb33405..29d2ca9 100644 --- a/docs/elements/trace.mdx +++ b/docs/elements/trace.mdx @@ -160,12 +160,9 @@ refer to the traces by `name` or by a specific pin selector. ) `} /> -The constraint is passed to the autorouter. Supported autorouters try to add -length to the shorter route until the absolute difference is at most -`maxLengthSkew`. The routed lengths and tolerance are measured in millimeters, -not as a ratio. This only constrains routed length; it does not set pair spacing -or differential impedance. See the dedicated page for complete trace-name and -pin-selector examples. +`maxLengthSkew` sets the maximum absolute routed-length difference in +millimeters. It does not set pair spacing or differential impedance. See the +dedicated page for complete trace-name and pin-selector examples. ## Net vs Direct connections From b6aeaa8a018d7e6c075189034397242a6234181c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?0hm=E2=98=98=EF=B8=8F?= Date: Sat, 18 Jul 2026 00:49:14 +0530 Subject: [PATCH 6/6] Clarify tested differential pair constraints --- docs/elements/differential-pair.mdx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/elements/differential-pair.mdx b/docs/elements/differential-pair.mdx index 1843300..c056a6c 100644 --- a/docs/elements/differential-pair.mdx +++ b/docs/elements/differential-pair.mdx @@ -107,9 +107,9 @@ Each value must ultimately resolve to exactly one trace in the same board or autorouted subcircuit. If a selected pin connects to multiple `` elements, use a trace name -to avoid an ambiguous match. When using -[phased autorouting](./autoroutingphase.mdx), give both traces the same -`routingPhaseIndex`. +to avoid an ambiguous match. In +[phased autorouting](./autoroutingphase.mdx), the `routingPhaseIndex` prop +assigns a `` to a phase. Both traces in a pair must use the same value. ## Properties @@ -118,4 +118,4 @@ to avoid an ambiguous match. When using | `name` | `string` | Optional name for the differential pair. | | `positiveConnection` | `string` | Exact positive trace name or port selector. | | `negativeConnection` | `string` | Exact negative trace name or port selector. | -| `maxLengthSkew` | `number` | Maximum absolute difference between the routed lengths, in millimeters—not a ratio. Accepts any non-negative distance and defaults to `0.1` mm. | +| `maxLengthSkew` | `number` | Maximum absolute difference between the routed lengths, in millimeters. Accepts any non-negative distance and defaults to `0.1` mm. |