From 3d242240905bb7ba755c1ac35ade0f52f41566ca Mon Sep 17 00:00:00 2001 From: Mustafa Mulla Date: Wed, 11 Mar 2026 23:28:28 +0530 Subject: [PATCH 1/3] Feat: builtin footprints courtyard generation --- src/footprinter.ts | 5 +- src/helpers/courtyard.ts | 67 +++++++++++++++++++ .../__snapshots__/0402_metric_parity.snap.svg | 2 +- .../__snapshots__/0402_parity.snap.svg | 2 +- .../0402_x2_convex_parity.snap.svg | 2 +- .../__snapshots__/0402_x2_parity.snap.svg | 2 +- .../__snapshots__/0402_x4_parity.snap.svg | 2 +- .../__snapshots__/0603_metric_parity.snap.svg | 2 +- .../__snapshots__/0603_parity.snap.svg | 2 +- .../__snapshots__/0603_x2_parity.snap.svg | 2 +- .../__snapshots__/0603_x4_parity.snap.svg | 2 +- .../__snapshots__/0606_x2_parity.snap.svg | 2 +- .../__snapshots__/0805_parity.snap.svg | 2 +- .../__snapshots__/1206_parity.snap.svg | 2 +- .../__snapshots__/1206_x4_parity.snap.svg | 2 +- .../__snapshots__/1210_parity.snap.svg | 2 +- .../__snapshots__/1812_parity.snap.svg | 2 +- .../__snapshots__/2010_parity.snap.svg | 2 +- .../__snapshots__/2512_parity.snap.svg | 2 +- ...SON-10-1EP_3x3mm_P0.5mm_EP1.2x2mm.snap.svg | 2 +- ...-8-1EP_3x3mm_P0.65mm_EP1.65x2.4mm.snap.svg | 2 +- .../VSONP-8-1EP_5x6_P1.27mm.snap.svg | 2 +- .../__snapshots__/axial_parity.snap.svg | 2 +- .../__snapshots__/bga165.snap.svg | 2 +- .../kicad-parity/__snapshots__/dip10.snap.svg | 2 +- .../kicad-parity/__snapshots__/hc49.snap.svg | 2 +- .../__snapshots__/lqfp100.snap.svg | 2 +- .../__snapshots__/lqfp64.snap.svg | 2 +- .../__snapshots__/lqfp64_pw0.3.snap.svg | 2 +- .../kicad-parity/__snapshots__/melf.snap.svg | 2 +- .../__snapshots__/micromelf.snap.svg | 2 +- .../__snapshots__/minimelf.snap.svg | 2 +- .../qfn32_thermalpad3.1x3.1mm.snap.svg | 2 +- .../__snapshots__/radial_parity_p5mm.snap.svg | 2 +- .../__snapshots__/sod123.snap.svg | 2 +- .../__snapshots__/sod123f.snap.svg | 2 +- .../__snapshots__/sod923.snap.svg | 2 +- .../__snapshots__/soic20.snap.svg | 2 +- .../kicad-parity/__snapshots__/sop-8.snap.svg | 2 +- .../__snapshots__/sot-723.snap.svg | 2 +- .../__snapshots__/sot-963.snap.svg | 2 +- .../__snapshots__/sot223_5.snap.svg | 2 +- .../kicad-parity/__snapshots__/sot23.snap.svg | 2 +- .../__snapshots__/sot323.snap.svg | 2 +- .../__snapshots__/sot343.snap.svg | 2 +- .../__snapshots__/sot363.snap.svg | 2 +- .../__snapshots__/sot563.snap.svg | 2 +- .../__snapshots__/sot886.snap.svg | 2 +- .../kicad-parity/__snapshots__/sot89.snap.svg | 2 +- .../__snapshots__/sot89_5.snap.svg | 2 +- .../__snapshots__/ssop10.snap.svg | 2 +- .../kicad-parity/__snapshots__/to92.snap.svg | 2 +- .../__snapshots__/to92l_parity.snap.svg | 2 +- .../__snapshots__/tqfp100.snap.svg | 2 +- .../__snapshots__/tqfp32.snap.svg | 2 +- .../__snapshots__/tqfp48.snap.svg | 2 +- .../__snapshots__/tqfp64.snap.svg | 2 +- .../__snapshots__/tssop10.snap.svg | 2 +- tests/pad.test.ts | 24 +++++++ 59 files changed, 151 insertions(+), 57 deletions(-) create mode 100644 src/helpers/courtyard.ts diff --git a/src/footprinter.ts b/src/footprinter.ts index 6af68a44..cccf0990 100644 --- a/src/footprinter.ts +++ b/src/footprinter.ts @@ -4,6 +4,7 @@ import * as FOOTPRINT_FN from "./fn" import { applyNoRefDes } from "./helpers/apply-norefdes" import { applyNoSilkscreen } from "./helpers/apply-nosilkscreen" import { applyOrigin } from "./helpers/apply-origin" +import { addCourtyardFromPads } from "./helpers/courtyard" import { isNotNull } from "./helpers/is-not-null" import { footprintSizes } from "./helpers/passive-fn" import type { AnyFootprinterDefinitionOutput } from "./helpers/zod/AnyFootprinterDefinitionOutput" @@ -354,7 +355,9 @@ export const footprinter = (): Footprinter & { circuitWithoutSilkscreen, target, ) - return applyOrigin(circuitWithoutRefDes, target.origin) + return addCourtyardFromPads( + applyOrigin(circuitWithoutRefDes, target.origin), + ) } } diff --git a/src/helpers/courtyard.ts b/src/helpers/courtyard.ts new file mode 100644 index 00000000..e485b15c --- /dev/null +++ b/src/helpers/courtyard.ts @@ -0,0 +1,67 @@ +import type { AnyCircuitElement, PcbCourtyardRect } from "circuit-json" + +const MARGIN = 0.25 + +export const addCourtyardFromPads = ( + elements: AnyCircuitElement[], +): AnyCircuitElement[] => { + const pads = elements.filter( + (el) => el.type === "pcb_smtpad" || el.type === "pcb_plated_hole", + ) as Array + + if (pads.length === 0) return elements + + let minX = Number.POSITIVE_INFINITY + let maxX = Number.NEGATIVE_INFINITY + let minY = Number.POSITIVE_INFINITY + let maxY = Number.NEGATIVE_INFINITY + + for (const pad of pads) { + let w = 0 + let h = 0 + if (pad.type === "pcb_smtpad") { + w = pad.shape === "circle" ? pad.radius * 2 : pad.width + h = pad.shape === "circle" ? pad.radius * 2 : pad.height + } else if (pad.type === "pcb_plated_hole") { + const d = pad.outer_diameter ?? pad.hole_diameter + w = d + h = d + } + minX = Math.min(minX, pad.x - w / 2) + maxX = Math.max(maxX, pad.x + w / 2) + minY = Math.min(minY, pad.y - h / 2) + maxY = Math.max(maxY, pad.y + h / 2) + } + + for (const el of elements as Array) { + if (el.type === "pcb_silkscreen_path" && Array.isArray(el.route)) { + for (const pt of el.route) { + minX = Math.min(minX, pt.x) + maxX = Math.max(maxX, pt.x) + minY = Math.min(minY, pt.y) + maxY = Math.max(maxY, pt.y) + } + } + } + + const width = maxX - minX + MARGIN * 2 + const height = maxY - minY + MARGIN * 2 + const centerX = (minX + maxX) / 2 + const centerY = (minY + maxY) / 2 + + const pcbComponent = (elements as Array).find( + (el) => el.type === "pcb_component", + ) + + const courtyard: PcbCourtyardRect = { + type: "pcb_courtyard_rect", + pcb_courtyard_rect_id: `pcb_courtyard_rect_${pcbComponent?.pcb_component_id ?? "1"}`, + pcb_component_id: pcbComponent?.pcb_component_id ?? "", + center: { x: centerX, y: centerY }, + width, + height, + layer: "top", + } + + return [...elements, courtyard] +} diff --git a/tests/kicad-parity/__snapshots__/0402_metric_parity.snap.svg b/tests/kicad-parity/__snapshots__/0402_metric_parity.snap.svg index 3dfa9d60..b502a83a 100644 --- a/tests/kicad-parity/__snapshots__/0402_metric_parity.snap.svg +++ b/tests/kicad-parity/__snapshots__/0402_metric_parity.snap.svg @@ -1 +1 @@ -{REF}Diff: 0.00% \ No newline at end of file +{REF}Diff: 0.00% \ No newline at end of file diff --git a/tests/kicad-parity/__snapshots__/0402_parity.snap.svg b/tests/kicad-parity/__snapshots__/0402_parity.snap.svg index 5a674199..c4950105 100644 --- a/tests/kicad-parity/__snapshots__/0402_parity.snap.svg +++ b/tests/kicad-parity/__snapshots__/0402_parity.snap.svg @@ -1 +1 @@ -{REF}Diff: 0.00% \ No newline at end of file +{REF}Diff: 0.00% \ No newline at end of file diff --git a/tests/kicad-parity/__snapshots__/0402_x2_convex_parity.snap.svg b/tests/kicad-parity/__snapshots__/0402_x2_convex_parity.snap.svg index 155bab2e..c1730807 100644 --- a/tests/kicad-parity/__snapshots__/0402_x2_convex_parity.snap.svg +++ b/tests/kicad-parity/__snapshots__/0402_x2_convex_parity.snap.svg @@ -1 +1 @@ -{REF}Diff: 0.00% \ No newline at end of file +{REF}Diff: 0.00% \ No newline at end of file diff --git a/tests/kicad-parity/__snapshots__/0402_x2_parity.snap.svg b/tests/kicad-parity/__snapshots__/0402_x2_parity.snap.svg index 155bab2e..c1730807 100644 --- a/tests/kicad-parity/__snapshots__/0402_x2_parity.snap.svg +++ b/tests/kicad-parity/__snapshots__/0402_x2_parity.snap.svg @@ -1 +1 @@ -{REF}Diff: 0.00% \ No newline at end of file +{REF}Diff: 0.00% \ No newline at end of file diff --git a/tests/kicad-parity/__snapshots__/0402_x4_parity.snap.svg b/tests/kicad-parity/__snapshots__/0402_x4_parity.snap.svg index 15bf9f8c..dee43de0 100644 --- a/tests/kicad-parity/__snapshots__/0402_x4_parity.snap.svg +++ b/tests/kicad-parity/__snapshots__/0402_x4_parity.snap.svg @@ -1 +1 @@ -{REF}Diff: 0.00% \ No newline at end of file +{REF}Diff: 0.00% \ No newline at end of file diff --git a/tests/kicad-parity/__snapshots__/0603_metric_parity.snap.svg b/tests/kicad-parity/__snapshots__/0603_metric_parity.snap.svg index fbd414f3..408ae6cb 100644 --- a/tests/kicad-parity/__snapshots__/0603_metric_parity.snap.svg +++ b/tests/kicad-parity/__snapshots__/0603_metric_parity.snap.svg @@ -1 +1 @@ -{REF}Diff: 0.00% \ No newline at end of file +{REF}Diff: 0.00% \ No newline at end of file diff --git a/tests/kicad-parity/__snapshots__/0603_parity.snap.svg b/tests/kicad-parity/__snapshots__/0603_parity.snap.svg index 9a81e02e..5f9b081a 100644 --- a/tests/kicad-parity/__snapshots__/0603_parity.snap.svg +++ b/tests/kicad-parity/__snapshots__/0603_parity.snap.svg @@ -1 +1 @@ -{REF}Diff: 0.00% \ No newline at end of file +{REF}Diff: 0.00% \ No newline at end of file diff --git a/tests/kicad-parity/__snapshots__/0603_x2_parity.snap.svg b/tests/kicad-parity/__snapshots__/0603_x2_parity.snap.svg index d55c1c88..9a7c9c40 100644 --- a/tests/kicad-parity/__snapshots__/0603_x2_parity.snap.svg +++ b/tests/kicad-parity/__snapshots__/0603_x2_parity.snap.svg @@ -1 +1 @@ -{REF}Diff: 0.00% \ No newline at end of file +{REF}Diff: 0.00% \ No newline at end of file diff --git a/tests/kicad-parity/__snapshots__/0603_x4_parity.snap.svg b/tests/kicad-parity/__snapshots__/0603_x4_parity.snap.svg index d02975e0..36a42c58 100644 --- a/tests/kicad-parity/__snapshots__/0603_x4_parity.snap.svg +++ b/tests/kicad-parity/__snapshots__/0603_x4_parity.snap.svg @@ -1 +1 @@ -{REF}Diff: 0.00% \ No newline at end of file +{REF}Diff: 0.00% \ No newline at end of file diff --git a/tests/kicad-parity/__snapshots__/0606_x2_parity.snap.svg b/tests/kicad-parity/__snapshots__/0606_x2_parity.snap.svg index 9d580edf..70c86a49 100644 --- a/tests/kicad-parity/__snapshots__/0606_x2_parity.snap.svg +++ b/tests/kicad-parity/__snapshots__/0606_x2_parity.snap.svg @@ -1 +1 @@ -{REF}Diff: 0.00% \ No newline at end of file +{REF}Diff: 0.00% \ No newline at end of file diff --git a/tests/kicad-parity/__snapshots__/0805_parity.snap.svg b/tests/kicad-parity/__snapshots__/0805_parity.snap.svg index 803db54d..0af1c90b 100644 --- a/tests/kicad-parity/__snapshots__/0805_parity.snap.svg +++ b/tests/kicad-parity/__snapshots__/0805_parity.snap.svg @@ -1 +1 @@ -{REF}Diff: 0.00% \ No newline at end of file +{REF}Diff: 0.00% \ No newline at end of file diff --git a/tests/kicad-parity/__snapshots__/1206_parity.snap.svg b/tests/kicad-parity/__snapshots__/1206_parity.snap.svg index a4910432..17ef5740 100644 --- a/tests/kicad-parity/__snapshots__/1206_parity.snap.svg +++ b/tests/kicad-parity/__snapshots__/1206_parity.snap.svg @@ -1 +1 @@ -{REF}Diff: 0.00% \ No newline at end of file +{REF}Diff: 0.00% \ No newline at end of file diff --git a/tests/kicad-parity/__snapshots__/1206_x4_parity.snap.svg b/tests/kicad-parity/__snapshots__/1206_x4_parity.snap.svg index c3617952..aaeea807 100644 --- a/tests/kicad-parity/__snapshots__/1206_x4_parity.snap.svg +++ b/tests/kicad-parity/__snapshots__/1206_x4_parity.snap.svg @@ -1 +1 @@ -{REF}Diff: 0.00% \ No newline at end of file +{REF}Diff: 0.00% \ No newline at end of file diff --git a/tests/kicad-parity/__snapshots__/1210_parity.snap.svg b/tests/kicad-parity/__snapshots__/1210_parity.snap.svg index 8840e97e..69bc379d 100644 --- a/tests/kicad-parity/__snapshots__/1210_parity.snap.svg +++ b/tests/kicad-parity/__snapshots__/1210_parity.snap.svg @@ -1 +1 @@ -{REF}Diff: 0.00% \ No newline at end of file +{REF}Diff: 0.00% \ No newline at end of file diff --git a/tests/kicad-parity/__snapshots__/1812_parity.snap.svg b/tests/kicad-parity/__snapshots__/1812_parity.snap.svg index a8ac3582..4c1d2d01 100644 --- a/tests/kicad-parity/__snapshots__/1812_parity.snap.svg +++ b/tests/kicad-parity/__snapshots__/1812_parity.snap.svg @@ -1 +1 @@ -{REF}Diff: 0.00% \ No newline at end of file +{REF}Diff: 0.00% \ No newline at end of file diff --git a/tests/kicad-parity/__snapshots__/2010_parity.snap.svg b/tests/kicad-parity/__snapshots__/2010_parity.snap.svg index 646f7b18..2a029841 100644 --- a/tests/kicad-parity/__snapshots__/2010_parity.snap.svg +++ b/tests/kicad-parity/__snapshots__/2010_parity.snap.svg @@ -1 +1 @@ -{REF}Diff: 0.00% \ No newline at end of file +{REF}Diff: 0.00% \ No newline at end of file diff --git a/tests/kicad-parity/__snapshots__/2512_parity.snap.svg b/tests/kicad-parity/__snapshots__/2512_parity.snap.svg index d1105680..a94959d4 100644 --- a/tests/kicad-parity/__snapshots__/2512_parity.snap.svg +++ b/tests/kicad-parity/__snapshots__/2512_parity.snap.svg @@ -1 +1 @@ -{REF}Diff: 0.00% \ No newline at end of file +{REF}Diff: 0.00% \ No newline at end of file diff --git a/tests/kicad-parity/__snapshots__/VSON-10-1EP_3x3mm_P0.5mm_EP1.2x2mm.snap.svg b/tests/kicad-parity/__snapshots__/VSON-10-1EP_3x3mm_P0.5mm_EP1.2x2mm.snap.svg index fccdb5a0..e46696a1 100644 --- a/tests/kicad-parity/__snapshots__/VSON-10-1EP_3x3mm_P0.5mm_EP1.2x2mm.snap.svg +++ b/tests/kicad-parity/__snapshots__/VSON-10-1EP_3x3mm_P0.5mm_EP1.2x2mm.snap.svg @@ -1 +1 @@ -{REF}Diff: 0.00% \ No newline at end of file +{REF}Diff: 0.00% \ No newline at end of file diff --git a/tests/kicad-parity/__snapshots__/VSON-8-1EP_3x3mm_P0.65mm_EP1.65x2.4mm.snap.svg b/tests/kicad-parity/__snapshots__/VSON-8-1EP_3x3mm_P0.65mm_EP1.65x2.4mm.snap.svg index 800683b2..fd24fa8a 100644 --- a/tests/kicad-parity/__snapshots__/VSON-8-1EP_3x3mm_P0.65mm_EP1.65x2.4mm.snap.svg +++ b/tests/kicad-parity/__snapshots__/VSON-8-1EP_3x3mm_P0.65mm_EP1.65x2.4mm.snap.svg @@ -1 +1 @@ -{REF}Diff: 0.00% \ No newline at end of file +{REF}Diff: 0.00% \ No newline at end of file diff --git a/tests/kicad-parity/__snapshots__/VSONP-8-1EP_5x6_P1.27mm.snap.svg b/tests/kicad-parity/__snapshots__/VSONP-8-1EP_5x6_P1.27mm.snap.svg index 4bf72363..43db1c02 100644 --- a/tests/kicad-parity/__snapshots__/VSONP-8-1EP_5x6_P1.27mm.snap.svg +++ b/tests/kicad-parity/__snapshots__/VSONP-8-1EP_5x6_P1.27mm.snap.svg @@ -1 +1 @@ -{REF}Diff: 0.00% \ No newline at end of file +{REF}Diff: 0.00% \ No newline at end of file diff --git a/tests/kicad-parity/__snapshots__/axial_parity.snap.svg b/tests/kicad-parity/__snapshots__/axial_parity.snap.svg index bee34abd..606cee9c 100644 --- a/tests/kicad-parity/__snapshots__/axial_parity.snap.svg +++ b/tests/kicad-parity/__snapshots__/axial_parity.snap.svg @@ -1 +1 @@ -{REF}Diff: 0.00% \ No newline at end of file +{REF}Diff: 0.00% \ No newline at end of file diff --git a/tests/kicad-parity/__snapshots__/bga165.snap.svg b/tests/kicad-parity/__snapshots__/bga165.snap.svg index 0bcdc345..b0ce9d12 100644 --- a/tests/kicad-parity/__snapshots__/bga165.snap.svg +++ b/tests/kicad-parity/__snapshots__/bga165.snap.svg @@ -1 +1 @@ -{REF}Diff: 5.66% \ No newline at end of file +{REF}Diff: 5.66% \ No newline at end of file diff --git a/tests/kicad-parity/__snapshots__/dip10.snap.svg b/tests/kicad-parity/__snapshots__/dip10.snap.svg index e7cdd830..e466a6be 100644 --- a/tests/kicad-parity/__snapshots__/dip10.snap.svg +++ b/tests/kicad-parity/__snapshots__/dip10.snap.svg @@ -1 +1 @@ -{REF}Diff: 0.00%{pin1}{pin2}{pin3}{pin4}{pin5}{pin6}{pin7}{pin8}{pin9}{pin10} \ No newline at end of file +{REF}Diff: 0.00%{pin1}{pin2}{pin3}{pin4}{pin5}{pin6}{pin7}{pin8}{pin9}{pin10} \ No newline at end of file diff --git a/tests/kicad-parity/__snapshots__/hc49.snap.svg b/tests/kicad-parity/__snapshots__/hc49.snap.svg index bbe9653e..f6c53e8d 100644 --- a/tests/kicad-parity/__snapshots__/hc49.snap.svg +++ b/tests/kicad-parity/__snapshots__/hc49.snap.svg @@ -1 +1 @@ -{REF}Diff: 0.00% \ No newline at end of file +{REF}Diff: 0.00% \ No newline at end of file diff --git a/tests/kicad-parity/__snapshots__/lqfp100.snap.svg b/tests/kicad-parity/__snapshots__/lqfp100.snap.svg index 54a91b02..0bf63419 100644 --- a/tests/kicad-parity/__snapshots__/lqfp100.snap.svg +++ b/tests/kicad-parity/__snapshots__/lqfp100.snap.svg @@ -1 +1 @@ -{REF}Diff: 0.41% \ No newline at end of file +{REF}Diff: 0.41% \ No newline at end of file diff --git a/tests/kicad-parity/__snapshots__/lqfp64.snap.svg b/tests/kicad-parity/__snapshots__/lqfp64.snap.svg index c958fcfc..31c78b71 100644 --- a/tests/kicad-parity/__snapshots__/lqfp64.snap.svg +++ b/tests/kicad-parity/__snapshots__/lqfp64.snap.svg @@ -1 +1 @@ -{REF}Diff: 1.64% \ No newline at end of file +{REF}Diff: 1.64% \ No newline at end of file diff --git a/tests/kicad-parity/__snapshots__/lqfp64_pw0.3.snap.svg b/tests/kicad-parity/__snapshots__/lqfp64_pw0.3.snap.svg index c958fcfc..31c78b71 100644 --- a/tests/kicad-parity/__snapshots__/lqfp64_pw0.3.snap.svg +++ b/tests/kicad-parity/__snapshots__/lqfp64_pw0.3.snap.svg @@ -1 +1 @@ -{REF}Diff: 1.64% \ No newline at end of file +{REF}Diff: 1.64% \ No newline at end of file diff --git a/tests/kicad-parity/__snapshots__/melf.snap.svg b/tests/kicad-parity/__snapshots__/melf.snap.svg index 027f8de5..75ec30ba 100644 --- a/tests/kicad-parity/__snapshots__/melf.snap.svg +++ b/tests/kicad-parity/__snapshots__/melf.snap.svg @@ -1 +1 @@ -{REF}Diff: 0.00% \ No newline at end of file +{REF}Diff: 0.00% \ No newline at end of file diff --git a/tests/kicad-parity/__snapshots__/micromelf.snap.svg b/tests/kicad-parity/__snapshots__/micromelf.snap.svg index 3e8f0640..4c83635a 100644 --- a/tests/kicad-parity/__snapshots__/micromelf.snap.svg +++ b/tests/kicad-parity/__snapshots__/micromelf.snap.svg @@ -1 +1 @@ -{REF}Diff: 0.00% \ No newline at end of file +{REF}Diff: 0.00% \ No newline at end of file diff --git a/tests/kicad-parity/__snapshots__/minimelf.snap.svg b/tests/kicad-parity/__snapshots__/minimelf.snap.svg index 2f912989..aa1d75c8 100644 --- a/tests/kicad-parity/__snapshots__/minimelf.snap.svg +++ b/tests/kicad-parity/__snapshots__/minimelf.snap.svg @@ -1 +1 @@ -{REF}Diff: 0.00% \ No newline at end of file +{REF}Diff: 0.00% \ No newline at end of file diff --git a/tests/kicad-parity/__snapshots__/qfn32_thermalpad3.1x3.1mm.snap.svg b/tests/kicad-parity/__snapshots__/qfn32_thermalpad3.1x3.1mm.snap.svg index 72d88111..d69da707 100644 --- a/tests/kicad-parity/__snapshots__/qfn32_thermalpad3.1x3.1mm.snap.svg +++ b/tests/kicad-parity/__snapshots__/qfn32_thermalpad3.1x3.1mm.snap.svg @@ -1 +1 @@ -{REF}Diff: 0.00% \ No newline at end of file +{REF}Diff: 0.00% \ No newline at end of file diff --git a/tests/kicad-parity/__snapshots__/radial_parity_p5mm.snap.svg b/tests/kicad-parity/__snapshots__/radial_parity_p5mm.snap.svg index 340abb30..da9bfed7 100644 --- a/tests/kicad-parity/__snapshots__/radial_parity_p5mm.snap.svg +++ b/tests/kicad-parity/__snapshots__/radial_parity_p5mm.snap.svg @@ -1 +1 @@ -{REF}Diff: 0.00% \ No newline at end of file +{REF}Diff: 0.00% \ No newline at end of file diff --git a/tests/kicad-parity/__snapshots__/sod123.snap.svg b/tests/kicad-parity/__snapshots__/sod123.snap.svg index dad99e40..54a08c25 100644 --- a/tests/kicad-parity/__snapshots__/sod123.snap.svg +++ b/tests/kicad-parity/__snapshots__/sod123.snap.svg @@ -1 +1 @@ -{REF}Diff: 0.00% \ No newline at end of file +{REF}Diff: 0.00% \ No newline at end of file diff --git a/tests/kicad-parity/__snapshots__/sod123f.snap.svg b/tests/kicad-parity/__snapshots__/sod123f.snap.svg index 7c647817..a0ca55ae 100644 --- a/tests/kicad-parity/__snapshots__/sod123f.snap.svg +++ b/tests/kicad-parity/__snapshots__/sod123f.snap.svg @@ -1 +1 @@ -{REF}Diff: 0.00% \ No newline at end of file +{REF}Diff: 0.00% \ No newline at end of file diff --git a/tests/kicad-parity/__snapshots__/sod923.snap.svg b/tests/kicad-parity/__snapshots__/sod923.snap.svg index 5706ded7..87317068 100644 --- a/tests/kicad-parity/__snapshots__/sod923.snap.svg +++ b/tests/kicad-parity/__snapshots__/sod923.snap.svg @@ -1 +1 @@ -{REF}Diff: 0.00% \ No newline at end of file +{REF}Diff: 0.00% \ No newline at end of file diff --git a/tests/kicad-parity/__snapshots__/soic20.snap.svg b/tests/kicad-parity/__snapshots__/soic20.snap.svg index 940a4570..2e94c9dd 100644 --- a/tests/kicad-parity/__snapshots__/soic20.snap.svg +++ b/tests/kicad-parity/__snapshots__/soic20.snap.svg @@ -1 +1 @@ -{REF}Diff: 28.80% \ No newline at end of file +{REF}Diff: 28.80% \ No newline at end of file diff --git a/tests/kicad-parity/__snapshots__/sop-8.snap.svg b/tests/kicad-parity/__snapshots__/sop-8.snap.svg index 2c137663..790f6f88 100644 --- a/tests/kicad-parity/__snapshots__/sop-8.snap.svg +++ b/tests/kicad-parity/__snapshots__/sop-8.snap.svg @@ -1 +1 @@ -{REF}Diff: 0.00% \ No newline at end of file +{REF}Diff: 0.00% \ No newline at end of file diff --git a/tests/kicad-parity/__snapshots__/sot-723.snap.svg b/tests/kicad-parity/__snapshots__/sot-723.snap.svg index b9bc1622..ac1462f5 100644 --- a/tests/kicad-parity/__snapshots__/sot-723.snap.svg +++ b/tests/kicad-parity/__snapshots__/sot-723.snap.svg @@ -1 +1 @@ -{REF}Diff: 0.00% \ No newline at end of file +{REF}Diff: 0.00% \ No newline at end of file diff --git a/tests/kicad-parity/__snapshots__/sot-963.snap.svg b/tests/kicad-parity/__snapshots__/sot-963.snap.svg index 10a0c227..5a5cc94c 100644 --- a/tests/kicad-parity/__snapshots__/sot-963.snap.svg +++ b/tests/kicad-parity/__snapshots__/sot-963.snap.svg @@ -1 +1 @@ -{REF}Diff: 0.00% \ No newline at end of file +{REF}Diff: 0.00% \ No newline at end of file diff --git a/tests/kicad-parity/__snapshots__/sot223_5.snap.svg b/tests/kicad-parity/__snapshots__/sot223_5.snap.svg index 055d886f..ca1f02d6 100644 --- a/tests/kicad-parity/__snapshots__/sot223_5.snap.svg +++ b/tests/kicad-parity/__snapshots__/sot223_5.snap.svg @@ -1 +1 @@ -{REF}Diff: 0.00% \ No newline at end of file +{REF}Diff: 0.00% \ No newline at end of file diff --git a/tests/kicad-parity/__snapshots__/sot23.snap.svg b/tests/kicad-parity/__snapshots__/sot23.snap.svg index 00b4d61f..c6d7c39f 100644 --- a/tests/kicad-parity/__snapshots__/sot23.snap.svg +++ b/tests/kicad-parity/__snapshots__/sot23.snap.svg @@ -1 +1 @@ -{REF}Diff: 0.19% \ No newline at end of file +{REF}Diff: 0.19% \ No newline at end of file diff --git a/tests/kicad-parity/__snapshots__/sot323.snap.svg b/tests/kicad-parity/__snapshots__/sot323.snap.svg index 91540cf4..f0910cc9 100644 --- a/tests/kicad-parity/__snapshots__/sot323.snap.svg +++ b/tests/kicad-parity/__snapshots__/sot323.snap.svg @@ -1 +1 @@ -{REF}Diff: 0.27% \ No newline at end of file +{REF}Diff: 0.27% \ No newline at end of file diff --git a/tests/kicad-parity/__snapshots__/sot343.snap.svg b/tests/kicad-parity/__snapshots__/sot343.snap.svg index 2e5aa59d..6c993e48 100644 --- a/tests/kicad-parity/__snapshots__/sot343.snap.svg +++ b/tests/kicad-parity/__snapshots__/sot343.snap.svg @@ -1 +1 @@ -{REF}Diff: 0.00% \ No newline at end of file +{REF}Diff: 0.00% \ No newline at end of file diff --git a/tests/kicad-parity/__snapshots__/sot363.snap.svg b/tests/kicad-parity/__snapshots__/sot363.snap.svg index 982e4dd1..9a595ca4 100644 --- a/tests/kicad-parity/__snapshots__/sot363.snap.svg +++ b/tests/kicad-parity/__snapshots__/sot363.snap.svg @@ -1 +1 @@ -{REF}Diff: 0.24% \ No newline at end of file +{REF}Diff: 0.24% \ No newline at end of file diff --git a/tests/kicad-parity/__snapshots__/sot563.snap.svg b/tests/kicad-parity/__snapshots__/sot563.snap.svg index 73af0c02..fcf307bf 100644 --- a/tests/kicad-parity/__snapshots__/sot563.snap.svg +++ b/tests/kicad-parity/__snapshots__/sot563.snap.svg @@ -1 +1 @@ -{REF}Diff: 0.00% \ No newline at end of file +{REF}Diff: 0.00% \ No newline at end of file diff --git a/tests/kicad-parity/__snapshots__/sot886.snap.svg b/tests/kicad-parity/__snapshots__/sot886.snap.svg index 26058ad1..539939de 100644 --- a/tests/kicad-parity/__snapshots__/sot886.snap.svg +++ b/tests/kicad-parity/__snapshots__/sot886.snap.svg @@ -1 +1 @@ -{REF}Diff: 0.00% \ No newline at end of file +{REF}Diff: 0.00% \ No newline at end of file diff --git a/tests/kicad-parity/__snapshots__/sot89.snap.svg b/tests/kicad-parity/__snapshots__/sot89.snap.svg index 2e2c205c..0c945c74 100644 --- a/tests/kicad-parity/__snapshots__/sot89.snap.svg +++ b/tests/kicad-parity/__snapshots__/sot89.snap.svg @@ -1 +1 @@ -{REF}Diff: 0.00% \ No newline at end of file +{REF}Diff: 0.00% \ No newline at end of file diff --git a/tests/kicad-parity/__snapshots__/sot89_5.snap.svg b/tests/kicad-parity/__snapshots__/sot89_5.snap.svg index 3f5428e8..53ab3587 100644 --- a/tests/kicad-parity/__snapshots__/sot89_5.snap.svg +++ b/tests/kicad-parity/__snapshots__/sot89_5.snap.svg @@ -1 +1 @@ -{REF}Diff: 0.00% \ No newline at end of file +{REF}Diff: 0.00% \ No newline at end of file diff --git a/tests/kicad-parity/__snapshots__/ssop10.snap.svg b/tests/kicad-parity/__snapshots__/ssop10.snap.svg index 9b5239f4..99824de4 100644 --- a/tests/kicad-parity/__snapshots__/ssop10.snap.svg +++ b/tests/kicad-parity/__snapshots__/ssop10.snap.svg @@ -1 +1 @@ -{REF}Diff: 0.00% \ No newline at end of file +{REF}Diff: 0.00% \ No newline at end of file diff --git a/tests/kicad-parity/__snapshots__/to92.snap.svg b/tests/kicad-parity/__snapshots__/to92.snap.svg index 53325d3a..1ac2a3b2 100644 --- a/tests/kicad-parity/__snapshots__/to92.snap.svg +++ b/tests/kicad-parity/__snapshots__/to92.snap.svg @@ -1 +1 @@ -{REF}Diff: 0.00% \ No newline at end of file +{REF}Diff: 0.00% \ No newline at end of file diff --git a/tests/kicad-parity/__snapshots__/to92l_parity.snap.svg b/tests/kicad-parity/__snapshots__/to92l_parity.snap.svg index 668d7b94..428264eb 100644 --- a/tests/kicad-parity/__snapshots__/to92l_parity.snap.svg +++ b/tests/kicad-parity/__snapshots__/to92l_parity.snap.svg @@ -1 +1 @@ -{REF}Diff: 0.00% \ No newline at end of file +{REF}Diff: 0.00% \ No newline at end of file diff --git a/tests/kicad-parity/__snapshots__/tqfp100.snap.svg b/tests/kicad-parity/__snapshots__/tqfp100.snap.svg index 6e8b7d50..a69b5d8b 100644 --- a/tests/kicad-parity/__snapshots__/tqfp100.snap.svg +++ b/tests/kicad-parity/__snapshots__/tqfp100.snap.svg @@ -1 +1 @@ -{REF}Diff: 0.00% \ No newline at end of file +{REF}Diff: 0.00% \ No newline at end of file diff --git a/tests/kicad-parity/__snapshots__/tqfp32.snap.svg b/tests/kicad-parity/__snapshots__/tqfp32.snap.svg index 2002f1d2..b5cf2aa2 100644 --- a/tests/kicad-parity/__snapshots__/tqfp32.snap.svg +++ b/tests/kicad-parity/__snapshots__/tqfp32.snap.svg @@ -1 +1 @@ -{REF}Diff: 0.00% \ No newline at end of file +{REF}Diff: 0.00% \ No newline at end of file diff --git a/tests/kicad-parity/__snapshots__/tqfp48.snap.svg b/tests/kicad-parity/__snapshots__/tqfp48.snap.svg index 54863b15..9e175820 100644 --- a/tests/kicad-parity/__snapshots__/tqfp48.snap.svg +++ b/tests/kicad-parity/__snapshots__/tqfp48.snap.svg @@ -1 +1 @@ -{REF}Diff: 0.00% \ No newline at end of file +{REF}Diff: 0.00% \ No newline at end of file diff --git a/tests/kicad-parity/__snapshots__/tqfp64.snap.svg b/tests/kicad-parity/__snapshots__/tqfp64.snap.svg index 8751458b..343427a9 100644 --- a/tests/kicad-parity/__snapshots__/tqfp64.snap.svg +++ b/tests/kicad-parity/__snapshots__/tqfp64.snap.svg @@ -1 +1 @@ -{REF}Diff: 0.00% \ No newline at end of file +{REF}Diff: 0.00% \ No newline at end of file diff --git a/tests/kicad-parity/__snapshots__/tssop10.snap.svg b/tests/kicad-parity/__snapshots__/tssop10.snap.svg index 82e637df..a5274029 100644 --- a/tests/kicad-parity/__snapshots__/tssop10.snap.svg +++ b/tests/kicad-parity/__snapshots__/tssop10.snap.svg @@ -1 +1 @@ -{REF}Diff: 0.00% \ No newline at end of file +{REF}Diff: 0.00% \ No newline at end of file diff --git a/tests/pad.test.ts b/tests/pad.test.ts index d83144be..4140da77 100644 --- a/tests/pad.test.ts +++ b/tests/pad.test.ts @@ -34,6 +34,18 @@ test("pad footprint", async () => { "text": "{REF}", "type": "pcb_silkscreen_text", }, + { + "center": { + "x": 0, + "y": 0, + }, + "height": 1.5, + "layer": "top", + "pcb_component_id": "", + "pcb_courtyard_rect_id": "pcb_courtyard_rect_1", + "type": "pcb_courtyard_rect", + "width": 2.5, + }, ] `) snapshotSoup(soup) @@ -73,6 +85,18 @@ test("pad footprint with different dimensions", async () => { "text": "{REF}", "type": "pcb_silkscreen_text", }, + { + "center": { + "x": 0, + "y": 0, + }, + "height": 2.5, + "layer": "top", + "pcb_component_id": "", + "pcb_courtyard_rect_id": "pcb_courtyard_rect_1", + "type": "pcb_courtyard_rect", + "width": 3.5, + }, ] `) snapshotSoup(soup) From 86c4e13a032d40dd339cb62313a0266d955290c2 Mon Sep 17 00:00:00 2001 From: Mustafa Mulla Date: Thu, 12 Mar 2026 11:39:02 +0530 Subject: [PATCH 2/3] update --- src/footprinter.ts | 5 +- src/helpers/courtyard.ts | 67 ------------------- src/helpers/passive-fn.ts | 26 ++++++- .../__snapshots__/0402_metric_parity.snap.svg | 2 +- .../__snapshots__/0402_parity.snap.svg | 2 +- .../0402_x2_convex_parity.snap.svg | 2 +- .../__snapshots__/0402_x2_parity.snap.svg | 2 +- .../__snapshots__/0402_x4_parity.snap.svg | 2 +- .../__snapshots__/0603_metric_parity.snap.svg | 2 +- .../__snapshots__/0603_parity.snap.svg | 2 +- .../__snapshots__/0603_x2_parity.snap.svg | 2 +- .../__snapshots__/0603_x4_parity.snap.svg | 2 +- .../__snapshots__/0606_x2_parity.snap.svg | 2 +- .../__snapshots__/0805_parity.snap.svg | 2 +- .../__snapshots__/1206_parity.snap.svg | 2 +- .../__snapshots__/1206_x4_parity.snap.svg | 2 +- .../__snapshots__/1210_parity.snap.svg | 2 +- .../__snapshots__/1812_parity.snap.svg | 2 +- .../__snapshots__/2010_parity.snap.svg | 2 +- .../__snapshots__/2512_parity.snap.svg | 2 +- ...SON-10-1EP_3x3mm_P0.5mm_EP1.2x2mm.snap.svg | 2 +- ...-8-1EP_3x3mm_P0.65mm_EP1.65x2.4mm.snap.svg | 2 +- .../VSONP-8-1EP_5x6_P1.27mm.snap.svg | 2 +- .../__snapshots__/axial_parity.snap.svg | 2 +- .../__snapshots__/bga165.snap.svg | 2 +- .../kicad-parity/__snapshots__/dip10.snap.svg | 2 +- .../kicad-parity/__snapshots__/hc49.snap.svg | 2 +- .../__snapshots__/lqfp100.snap.svg | 2 +- .../__snapshots__/lqfp64.snap.svg | 2 +- .../__snapshots__/lqfp64_pw0.3.snap.svg | 2 +- .../kicad-parity/__snapshots__/melf.snap.svg | 2 +- .../__snapshots__/micromelf.snap.svg | 2 +- .../__snapshots__/minimelf.snap.svg | 2 +- .../qfn32_thermalpad3.1x3.1mm.snap.svg | 2 +- .../__snapshots__/radial_parity_p5mm.snap.svg | 2 +- .../__snapshots__/sod123.snap.svg | 2 +- .../__snapshots__/sod123f.snap.svg | 2 +- .../__snapshots__/sod923.snap.svg | 2 +- .../__snapshots__/soic20.snap.svg | 2 +- .../kicad-parity/__snapshots__/sop-8.snap.svg | 2 +- .../__snapshots__/sot-723.snap.svg | 2 +- .../__snapshots__/sot-963.snap.svg | 2 +- .../__snapshots__/sot223_5.snap.svg | 2 +- .../kicad-parity/__snapshots__/sot23.snap.svg | 2 +- .../__snapshots__/sot323.snap.svg | 2 +- .../__snapshots__/sot343.snap.svg | 2 +- .../__snapshots__/sot363.snap.svg | 2 +- .../__snapshots__/sot563.snap.svg | 2 +- .../__snapshots__/sot886.snap.svg | 2 +- .../kicad-parity/__snapshots__/sot89.snap.svg | 2 +- .../__snapshots__/sot89_5.snap.svg | 2 +- .../__snapshots__/ssop10.snap.svg | 2 +- .../kicad-parity/__snapshots__/to92.snap.svg | 2 +- .../__snapshots__/to92l_parity.snap.svg | 2 +- .../__snapshots__/tqfp100.snap.svg | 2 +- .../__snapshots__/tqfp32.snap.svg | 2 +- .../__snapshots__/tqfp48.snap.svg | 2 +- .../__snapshots__/tqfp64.snap.svg | 2 +- .../__snapshots__/tssop10.snap.svg | 2 +- tests/pad.test.ts | 24 ------- 60 files changed, 82 insertions(+), 152 deletions(-) delete mode 100644 src/helpers/courtyard.ts diff --git a/src/footprinter.ts b/src/footprinter.ts index cccf0990..6af68a44 100644 --- a/src/footprinter.ts +++ b/src/footprinter.ts @@ -4,7 +4,6 @@ import * as FOOTPRINT_FN from "./fn" import { applyNoRefDes } from "./helpers/apply-norefdes" import { applyNoSilkscreen } from "./helpers/apply-nosilkscreen" import { applyOrigin } from "./helpers/apply-origin" -import { addCourtyardFromPads } from "./helpers/courtyard" import { isNotNull } from "./helpers/is-not-null" import { footprintSizes } from "./helpers/passive-fn" import type { AnyFootprinterDefinitionOutput } from "./helpers/zod/AnyFootprinterDefinitionOutput" @@ -355,9 +354,7 @@ export const footprinter = (): Footprinter & { circuitWithoutSilkscreen, target, ) - return addCourtyardFromPads( - applyOrigin(circuitWithoutRefDes, target.origin), - ) + return applyOrigin(circuitWithoutRefDes, target.origin) } } diff --git a/src/helpers/courtyard.ts b/src/helpers/courtyard.ts deleted file mode 100644 index e485b15c..00000000 --- a/src/helpers/courtyard.ts +++ /dev/null @@ -1,67 +0,0 @@ -import type { AnyCircuitElement, PcbCourtyardRect } from "circuit-json" - -const MARGIN = 0.25 - -export const addCourtyardFromPads = ( - elements: AnyCircuitElement[], -): AnyCircuitElement[] => { - const pads = elements.filter( - (el) => el.type === "pcb_smtpad" || el.type === "pcb_plated_hole", - ) as Array - - if (pads.length === 0) return elements - - let minX = Number.POSITIVE_INFINITY - let maxX = Number.NEGATIVE_INFINITY - let minY = Number.POSITIVE_INFINITY - let maxY = Number.NEGATIVE_INFINITY - - for (const pad of pads) { - let w = 0 - let h = 0 - if (pad.type === "pcb_smtpad") { - w = pad.shape === "circle" ? pad.radius * 2 : pad.width - h = pad.shape === "circle" ? pad.radius * 2 : pad.height - } else if (pad.type === "pcb_plated_hole") { - const d = pad.outer_diameter ?? pad.hole_diameter - w = d - h = d - } - minX = Math.min(minX, pad.x - w / 2) - maxX = Math.max(maxX, pad.x + w / 2) - minY = Math.min(minY, pad.y - h / 2) - maxY = Math.max(maxY, pad.y + h / 2) - } - - for (const el of elements as Array) { - if (el.type === "pcb_silkscreen_path" && Array.isArray(el.route)) { - for (const pt of el.route) { - minX = Math.min(minX, pt.x) - maxX = Math.max(maxX, pt.x) - minY = Math.min(minY, pt.y) - maxY = Math.max(maxY, pt.y) - } - } - } - - const width = maxX - minX + MARGIN * 2 - const height = maxY - minY + MARGIN * 2 - const centerX = (minX + maxX) / 2 - const centerY = (minY + maxY) / 2 - - const pcbComponent = (elements as Array).find( - (el) => el.type === "pcb_component", - ) - - const courtyard: PcbCourtyardRect = { - type: "pcb_courtyard_rect", - pcb_courtyard_rect_id: `pcb_courtyard_rect_${pcbComponent?.pcb_component_id ?? "1"}`, - pcb_component_id: pcbComponent?.pcb_component_id ?? "", - center: { x: centerX, y: centerY }, - width, - height, - layer: "top", - } - - return [...elements, courtyard] -} diff --git a/src/helpers/passive-fn.ts b/src/helpers/passive-fn.ts index c46e8931..4caf3400 100644 --- a/src/helpers/passive-fn.ts +++ b/src/helpers/passive-fn.ts @@ -1,4 +1,8 @@ -import type { AnyCircuitElement, PcbSilkscreenPath } from "circuit-json" +import type { + AnyCircuitElement, + PcbCourtyardRect, + PcbSilkscreenPath, +} from "circuit-json" import { rectpad } from "../helpers/rectpad" import mm from "@tscircuit/mm" import { platedhole } from "./platedhole" @@ -187,12 +191,31 @@ export const passive = (params: PassiveDef): AnyCircuitElement[] => { const textY = textbottom ? -ph / 2 - 0.9 : ph / 2 + 0.9 const silkscreenRefText: SilkscreenRef = silkscreenRef(0, textY, 0.2) + // courtyard must enclose body, pads, AND silkscreen outline + const excess = 0.25 + const silkscreenXs = silkscreenLine.route.map((pt) => Math.abs(pt.x)) + const silkscreenYs = silkscreenLine.route.map((pt) => Math.abs(pt.y)) + const maxSilkX = Math.max(...silkscreenXs) + const maxSilkY = Math.max(...silkscreenYs) + const crtHalfW = Math.max((w ?? 0) / 2, p / 2 + pw / 2, maxSilkX) + excess + const crtHalfH = Math.max((h ?? 0) / 2, ph / 2, maxSilkY) + excess + const courtyard: PcbCourtyardRect = { + type: "pcb_courtyard_rect", + pcb_courtyard_rect_id: "", + pcb_component_id: "", + center: { x: 0, y: 0 }, + width: crtHalfW * 2, + height: crtHalfH * 2, + layer: "top", + } + if (tht) { return [ platedhole(1, -p / 2, 0, pw, (pw * 1) / 0.8), platedhole(2, p / 2, 0, pw, (pw * 1) / 0.8), silkscreenLine, silkscreenRefText, + courtyard, ] } return [ @@ -200,5 +223,6 @@ export const passive = (params: PassiveDef): AnyCircuitElement[] => { rectpad(["2", "right"], p / 2, 0, pw, ph), silkscreenLine, silkscreenRefText, + courtyard, ] } diff --git a/tests/kicad-parity/__snapshots__/0402_metric_parity.snap.svg b/tests/kicad-parity/__snapshots__/0402_metric_parity.snap.svg index b502a83a..da948042 100644 --- a/tests/kicad-parity/__snapshots__/0402_metric_parity.snap.svg +++ b/tests/kicad-parity/__snapshots__/0402_metric_parity.snap.svg @@ -1 +1 @@ -{REF}Diff: 0.00% \ No newline at end of file +{REF}Diff: 0.00% \ No newline at end of file diff --git a/tests/kicad-parity/__snapshots__/0402_parity.snap.svg b/tests/kicad-parity/__snapshots__/0402_parity.snap.svg index c4950105..5402df40 100644 --- a/tests/kicad-parity/__snapshots__/0402_parity.snap.svg +++ b/tests/kicad-parity/__snapshots__/0402_parity.snap.svg @@ -1 +1 @@ -{REF}Diff: 0.00% \ No newline at end of file +{REF}Diff: 0.00% \ No newline at end of file diff --git a/tests/kicad-parity/__snapshots__/0402_x2_convex_parity.snap.svg b/tests/kicad-parity/__snapshots__/0402_x2_convex_parity.snap.svg index c1730807..155bab2e 100644 --- a/tests/kicad-parity/__snapshots__/0402_x2_convex_parity.snap.svg +++ b/tests/kicad-parity/__snapshots__/0402_x2_convex_parity.snap.svg @@ -1 +1 @@ -{REF}Diff: 0.00% \ No newline at end of file +{REF}Diff: 0.00% \ No newline at end of file diff --git a/tests/kicad-parity/__snapshots__/0402_x2_parity.snap.svg b/tests/kicad-parity/__snapshots__/0402_x2_parity.snap.svg index c1730807..155bab2e 100644 --- a/tests/kicad-parity/__snapshots__/0402_x2_parity.snap.svg +++ b/tests/kicad-parity/__snapshots__/0402_x2_parity.snap.svg @@ -1 +1 @@ -{REF}Diff: 0.00% \ No newline at end of file +{REF}Diff: 0.00% \ No newline at end of file diff --git a/tests/kicad-parity/__snapshots__/0402_x4_parity.snap.svg b/tests/kicad-parity/__snapshots__/0402_x4_parity.snap.svg index dee43de0..15bf9f8c 100644 --- a/tests/kicad-parity/__snapshots__/0402_x4_parity.snap.svg +++ b/tests/kicad-parity/__snapshots__/0402_x4_parity.snap.svg @@ -1 +1 @@ -{REF}Diff: 0.00% \ No newline at end of file +{REF}Diff: 0.00% \ No newline at end of file diff --git a/tests/kicad-parity/__snapshots__/0603_metric_parity.snap.svg b/tests/kicad-parity/__snapshots__/0603_metric_parity.snap.svg index 408ae6cb..6dcb25aa 100644 --- a/tests/kicad-parity/__snapshots__/0603_metric_parity.snap.svg +++ b/tests/kicad-parity/__snapshots__/0603_metric_parity.snap.svg @@ -1 +1 @@ -{REF}Diff: 0.00% \ No newline at end of file +{REF}Diff: 0.00% \ No newline at end of file diff --git a/tests/kicad-parity/__snapshots__/0603_parity.snap.svg b/tests/kicad-parity/__snapshots__/0603_parity.snap.svg index 5f9b081a..95b8ca3c 100644 --- a/tests/kicad-parity/__snapshots__/0603_parity.snap.svg +++ b/tests/kicad-parity/__snapshots__/0603_parity.snap.svg @@ -1 +1 @@ -{REF}Diff: 0.00% \ No newline at end of file +{REF}Diff: 0.00% \ No newline at end of file diff --git a/tests/kicad-parity/__snapshots__/0603_x2_parity.snap.svg b/tests/kicad-parity/__snapshots__/0603_x2_parity.snap.svg index 9a7c9c40..d55c1c88 100644 --- a/tests/kicad-parity/__snapshots__/0603_x2_parity.snap.svg +++ b/tests/kicad-parity/__snapshots__/0603_x2_parity.snap.svg @@ -1 +1 @@ -{REF}Diff: 0.00% \ No newline at end of file +{REF}Diff: 0.00% \ No newline at end of file diff --git a/tests/kicad-parity/__snapshots__/0603_x4_parity.snap.svg b/tests/kicad-parity/__snapshots__/0603_x4_parity.snap.svg index 36a42c58..d02975e0 100644 --- a/tests/kicad-parity/__snapshots__/0603_x4_parity.snap.svg +++ b/tests/kicad-parity/__snapshots__/0603_x4_parity.snap.svg @@ -1 +1 @@ -{REF}Diff: 0.00% \ No newline at end of file +{REF}Diff: 0.00% \ No newline at end of file diff --git a/tests/kicad-parity/__snapshots__/0606_x2_parity.snap.svg b/tests/kicad-parity/__snapshots__/0606_x2_parity.snap.svg index 70c86a49..9d580edf 100644 --- a/tests/kicad-parity/__snapshots__/0606_x2_parity.snap.svg +++ b/tests/kicad-parity/__snapshots__/0606_x2_parity.snap.svg @@ -1 +1 @@ -{REF}Diff: 0.00% \ No newline at end of file +{REF}Diff: 0.00% \ No newline at end of file diff --git a/tests/kicad-parity/__snapshots__/0805_parity.snap.svg b/tests/kicad-parity/__snapshots__/0805_parity.snap.svg index 0af1c90b..1953ba2d 100644 --- a/tests/kicad-parity/__snapshots__/0805_parity.snap.svg +++ b/tests/kicad-parity/__snapshots__/0805_parity.snap.svg @@ -1 +1 @@ -{REF}Diff: 0.00% \ No newline at end of file +{REF}Diff: 0.00% \ No newline at end of file diff --git a/tests/kicad-parity/__snapshots__/1206_parity.snap.svg b/tests/kicad-parity/__snapshots__/1206_parity.snap.svg index 17ef5740..69867e52 100644 --- a/tests/kicad-parity/__snapshots__/1206_parity.snap.svg +++ b/tests/kicad-parity/__snapshots__/1206_parity.snap.svg @@ -1 +1 @@ -{REF}Diff: 0.00% \ No newline at end of file +{REF}Diff: 0.00% \ No newline at end of file diff --git a/tests/kicad-parity/__snapshots__/1206_x4_parity.snap.svg b/tests/kicad-parity/__snapshots__/1206_x4_parity.snap.svg index aaeea807..c3617952 100644 --- a/tests/kicad-parity/__snapshots__/1206_x4_parity.snap.svg +++ b/tests/kicad-parity/__snapshots__/1206_x4_parity.snap.svg @@ -1 +1 @@ -{REF}Diff: 0.00% \ No newline at end of file +{REF}Diff: 0.00% \ No newline at end of file diff --git a/tests/kicad-parity/__snapshots__/1210_parity.snap.svg b/tests/kicad-parity/__snapshots__/1210_parity.snap.svg index 69bc379d..ffb285de 100644 --- a/tests/kicad-parity/__snapshots__/1210_parity.snap.svg +++ b/tests/kicad-parity/__snapshots__/1210_parity.snap.svg @@ -1 +1 @@ -{REF}Diff: 0.00% \ No newline at end of file +{REF}Diff: 0.00% \ No newline at end of file diff --git a/tests/kicad-parity/__snapshots__/1812_parity.snap.svg b/tests/kicad-parity/__snapshots__/1812_parity.snap.svg index 4c1d2d01..d97664ea 100644 --- a/tests/kicad-parity/__snapshots__/1812_parity.snap.svg +++ b/tests/kicad-parity/__snapshots__/1812_parity.snap.svg @@ -1 +1 @@ -{REF}Diff: 0.00% \ No newline at end of file +{REF}Diff: 0.00% \ No newline at end of file diff --git a/tests/kicad-parity/__snapshots__/2010_parity.snap.svg b/tests/kicad-parity/__snapshots__/2010_parity.snap.svg index 2a029841..6ced7683 100644 --- a/tests/kicad-parity/__snapshots__/2010_parity.snap.svg +++ b/tests/kicad-parity/__snapshots__/2010_parity.snap.svg @@ -1 +1 @@ -{REF}Diff: 0.00% \ No newline at end of file +{REF}Diff: 0.00% \ No newline at end of file diff --git a/tests/kicad-parity/__snapshots__/2512_parity.snap.svg b/tests/kicad-parity/__snapshots__/2512_parity.snap.svg index a94959d4..e9151a76 100644 --- a/tests/kicad-parity/__snapshots__/2512_parity.snap.svg +++ b/tests/kicad-parity/__snapshots__/2512_parity.snap.svg @@ -1 +1 @@ -{REF}Diff: 0.00% \ No newline at end of file +{REF}Diff: 0.00% \ No newline at end of file diff --git a/tests/kicad-parity/__snapshots__/VSON-10-1EP_3x3mm_P0.5mm_EP1.2x2mm.snap.svg b/tests/kicad-parity/__snapshots__/VSON-10-1EP_3x3mm_P0.5mm_EP1.2x2mm.snap.svg index e46696a1..fccdb5a0 100644 --- a/tests/kicad-parity/__snapshots__/VSON-10-1EP_3x3mm_P0.5mm_EP1.2x2mm.snap.svg +++ b/tests/kicad-parity/__snapshots__/VSON-10-1EP_3x3mm_P0.5mm_EP1.2x2mm.snap.svg @@ -1 +1 @@ -{REF}Diff: 0.00% \ No newline at end of file +{REF}Diff: 0.00% \ No newline at end of file diff --git a/tests/kicad-parity/__snapshots__/VSON-8-1EP_3x3mm_P0.65mm_EP1.65x2.4mm.snap.svg b/tests/kicad-parity/__snapshots__/VSON-8-1EP_3x3mm_P0.65mm_EP1.65x2.4mm.snap.svg index fd24fa8a..800683b2 100644 --- a/tests/kicad-parity/__snapshots__/VSON-8-1EP_3x3mm_P0.65mm_EP1.65x2.4mm.snap.svg +++ b/tests/kicad-parity/__snapshots__/VSON-8-1EP_3x3mm_P0.65mm_EP1.65x2.4mm.snap.svg @@ -1 +1 @@ -{REF}Diff: 0.00% \ No newline at end of file +{REF}Diff: 0.00% \ No newline at end of file diff --git a/tests/kicad-parity/__snapshots__/VSONP-8-1EP_5x6_P1.27mm.snap.svg b/tests/kicad-parity/__snapshots__/VSONP-8-1EP_5x6_P1.27mm.snap.svg index 43db1c02..4bf72363 100644 --- a/tests/kicad-parity/__snapshots__/VSONP-8-1EP_5x6_P1.27mm.snap.svg +++ b/tests/kicad-parity/__snapshots__/VSONP-8-1EP_5x6_P1.27mm.snap.svg @@ -1 +1 @@ -{REF}Diff: 0.00% \ No newline at end of file +{REF}Diff: 0.00% \ No newline at end of file diff --git a/tests/kicad-parity/__snapshots__/axial_parity.snap.svg b/tests/kicad-parity/__snapshots__/axial_parity.snap.svg index 606cee9c..bee34abd 100644 --- a/tests/kicad-parity/__snapshots__/axial_parity.snap.svg +++ b/tests/kicad-parity/__snapshots__/axial_parity.snap.svg @@ -1 +1 @@ -{REF}Diff: 0.00% \ No newline at end of file +{REF}Diff: 0.00% \ No newline at end of file diff --git a/tests/kicad-parity/__snapshots__/bga165.snap.svg b/tests/kicad-parity/__snapshots__/bga165.snap.svg index b0ce9d12..0bcdc345 100644 --- a/tests/kicad-parity/__snapshots__/bga165.snap.svg +++ b/tests/kicad-parity/__snapshots__/bga165.snap.svg @@ -1 +1 @@ -{REF}Diff: 5.66% \ No newline at end of file +{REF}Diff: 5.66% \ No newline at end of file diff --git a/tests/kicad-parity/__snapshots__/dip10.snap.svg b/tests/kicad-parity/__snapshots__/dip10.snap.svg index e466a6be..e7cdd830 100644 --- a/tests/kicad-parity/__snapshots__/dip10.snap.svg +++ b/tests/kicad-parity/__snapshots__/dip10.snap.svg @@ -1 +1 @@ -{REF}Diff: 0.00%{pin1}{pin2}{pin3}{pin4}{pin5}{pin6}{pin7}{pin8}{pin9}{pin10} \ No newline at end of file +{REF}Diff: 0.00%{pin1}{pin2}{pin3}{pin4}{pin5}{pin6}{pin7}{pin8}{pin9}{pin10} \ No newline at end of file diff --git a/tests/kicad-parity/__snapshots__/hc49.snap.svg b/tests/kicad-parity/__snapshots__/hc49.snap.svg index f6c53e8d..bbe9653e 100644 --- a/tests/kicad-parity/__snapshots__/hc49.snap.svg +++ b/tests/kicad-parity/__snapshots__/hc49.snap.svg @@ -1 +1 @@ -{REF}Diff: 0.00% \ No newline at end of file +{REF}Diff: 0.00% \ No newline at end of file diff --git a/tests/kicad-parity/__snapshots__/lqfp100.snap.svg b/tests/kicad-parity/__snapshots__/lqfp100.snap.svg index 0bf63419..54a91b02 100644 --- a/tests/kicad-parity/__snapshots__/lqfp100.snap.svg +++ b/tests/kicad-parity/__snapshots__/lqfp100.snap.svg @@ -1 +1 @@ -{REF}Diff: 0.41% \ No newline at end of file +{REF}Diff: 0.41% \ No newline at end of file diff --git a/tests/kicad-parity/__snapshots__/lqfp64.snap.svg b/tests/kicad-parity/__snapshots__/lqfp64.snap.svg index 31c78b71..c958fcfc 100644 --- a/tests/kicad-parity/__snapshots__/lqfp64.snap.svg +++ b/tests/kicad-parity/__snapshots__/lqfp64.snap.svg @@ -1 +1 @@ -{REF}Diff: 1.64% \ No newline at end of file +{REF}Diff: 1.64% \ No newline at end of file diff --git a/tests/kicad-parity/__snapshots__/lqfp64_pw0.3.snap.svg b/tests/kicad-parity/__snapshots__/lqfp64_pw0.3.snap.svg index 31c78b71..c958fcfc 100644 --- a/tests/kicad-parity/__snapshots__/lqfp64_pw0.3.snap.svg +++ b/tests/kicad-parity/__snapshots__/lqfp64_pw0.3.snap.svg @@ -1 +1 @@ -{REF}Diff: 1.64% \ No newline at end of file +{REF}Diff: 1.64% \ No newline at end of file diff --git a/tests/kicad-parity/__snapshots__/melf.snap.svg b/tests/kicad-parity/__snapshots__/melf.snap.svg index 75ec30ba..027f8de5 100644 --- a/tests/kicad-parity/__snapshots__/melf.snap.svg +++ b/tests/kicad-parity/__snapshots__/melf.snap.svg @@ -1 +1 @@ -{REF}Diff: 0.00% \ No newline at end of file +{REF}Diff: 0.00% \ No newline at end of file diff --git a/tests/kicad-parity/__snapshots__/micromelf.snap.svg b/tests/kicad-parity/__snapshots__/micromelf.snap.svg index 4c83635a..3e8f0640 100644 --- a/tests/kicad-parity/__snapshots__/micromelf.snap.svg +++ b/tests/kicad-parity/__snapshots__/micromelf.snap.svg @@ -1 +1 @@ -{REF}Diff: 0.00% \ No newline at end of file +{REF}Diff: 0.00% \ No newline at end of file diff --git a/tests/kicad-parity/__snapshots__/minimelf.snap.svg b/tests/kicad-parity/__snapshots__/minimelf.snap.svg index aa1d75c8..2f912989 100644 --- a/tests/kicad-parity/__snapshots__/minimelf.snap.svg +++ b/tests/kicad-parity/__snapshots__/minimelf.snap.svg @@ -1 +1 @@ -{REF}Diff: 0.00% \ No newline at end of file +{REF}Diff: 0.00% \ No newline at end of file diff --git a/tests/kicad-parity/__snapshots__/qfn32_thermalpad3.1x3.1mm.snap.svg b/tests/kicad-parity/__snapshots__/qfn32_thermalpad3.1x3.1mm.snap.svg index d69da707..72d88111 100644 --- a/tests/kicad-parity/__snapshots__/qfn32_thermalpad3.1x3.1mm.snap.svg +++ b/tests/kicad-parity/__snapshots__/qfn32_thermalpad3.1x3.1mm.snap.svg @@ -1 +1 @@ -{REF}Diff: 0.00% \ No newline at end of file +{REF}Diff: 0.00% \ No newline at end of file diff --git a/tests/kicad-parity/__snapshots__/radial_parity_p5mm.snap.svg b/tests/kicad-parity/__snapshots__/radial_parity_p5mm.snap.svg index da9bfed7..340abb30 100644 --- a/tests/kicad-parity/__snapshots__/radial_parity_p5mm.snap.svg +++ b/tests/kicad-parity/__snapshots__/radial_parity_p5mm.snap.svg @@ -1 +1 @@ -{REF}Diff: 0.00% \ No newline at end of file +{REF}Diff: 0.00% \ No newline at end of file diff --git a/tests/kicad-parity/__snapshots__/sod123.snap.svg b/tests/kicad-parity/__snapshots__/sod123.snap.svg index 54a08c25..dad99e40 100644 --- a/tests/kicad-parity/__snapshots__/sod123.snap.svg +++ b/tests/kicad-parity/__snapshots__/sod123.snap.svg @@ -1 +1 @@ -{REF}Diff: 0.00% \ No newline at end of file +{REF}Diff: 0.00% \ No newline at end of file diff --git a/tests/kicad-parity/__snapshots__/sod123f.snap.svg b/tests/kicad-parity/__snapshots__/sod123f.snap.svg index a0ca55ae..7c647817 100644 --- a/tests/kicad-parity/__snapshots__/sod123f.snap.svg +++ b/tests/kicad-parity/__snapshots__/sod123f.snap.svg @@ -1 +1 @@ -{REF}Diff: 0.00% \ No newline at end of file +{REF}Diff: 0.00% \ No newline at end of file diff --git a/tests/kicad-parity/__snapshots__/sod923.snap.svg b/tests/kicad-parity/__snapshots__/sod923.snap.svg index 87317068..5706ded7 100644 --- a/tests/kicad-parity/__snapshots__/sod923.snap.svg +++ b/tests/kicad-parity/__snapshots__/sod923.snap.svg @@ -1 +1 @@ -{REF}Diff: 0.00% \ No newline at end of file +{REF}Diff: 0.00% \ No newline at end of file diff --git a/tests/kicad-parity/__snapshots__/soic20.snap.svg b/tests/kicad-parity/__snapshots__/soic20.snap.svg index 2e94c9dd..940a4570 100644 --- a/tests/kicad-parity/__snapshots__/soic20.snap.svg +++ b/tests/kicad-parity/__snapshots__/soic20.snap.svg @@ -1 +1 @@ -{REF}Diff: 28.80% \ No newline at end of file +{REF}Diff: 28.80% \ No newline at end of file diff --git a/tests/kicad-parity/__snapshots__/sop-8.snap.svg b/tests/kicad-parity/__snapshots__/sop-8.snap.svg index 790f6f88..2c137663 100644 --- a/tests/kicad-parity/__snapshots__/sop-8.snap.svg +++ b/tests/kicad-parity/__snapshots__/sop-8.snap.svg @@ -1 +1 @@ -{REF}Diff: 0.00% \ No newline at end of file +{REF}Diff: 0.00% \ No newline at end of file diff --git a/tests/kicad-parity/__snapshots__/sot-723.snap.svg b/tests/kicad-parity/__snapshots__/sot-723.snap.svg index ac1462f5..b9bc1622 100644 --- a/tests/kicad-parity/__snapshots__/sot-723.snap.svg +++ b/tests/kicad-parity/__snapshots__/sot-723.snap.svg @@ -1 +1 @@ -{REF}Diff: 0.00% \ No newline at end of file +{REF}Diff: 0.00% \ No newline at end of file diff --git a/tests/kicad-parity/__snapshots__/sot-963.snap.svg b/tests/kicad-parity/__snapshots__/sot-963.snap.svg index 5a5cc94c..10a0c227 100644 --- a/tests/kicad-parity/__snapshots__/sot-963.snap.svg +++ b/tests/kicad-parity/__snapshots__/sot-963.snap.svg @@ -1 +1 @@ -{REF}Diff: 0.00% \ No newline at end of file +{REF}Diff: 0.00% \ No newline at end of file diff --git a/tests/kicad-parity/__snapshots__/sot223_5.snap.svg b/tests/kicad-parity/__snapshots__/sot223_5.snap.svg index ca1f02d6..055d886f 100644 --- a/tests/kicad-parity/__snapshots__/sot223_5.snap.svg +++ b/tests/kicad-parity/__snapshots__/sot223_5.snap.svg @@ -1 +1 @@ -{REF}Diff: 0.00% \ No newline at end of file +{REF}Diff: 0.00% \ No newline at end of file diff --git a/tests/kicad-parity/__snapshots__/sot23.snap.svg b/tests/kicad-parity/__snapshots__/sot23.snap.svg index c6d7c39f..00b4d61f 100644 --- a/tests/kicad-parity/__snapshots__/sot23.snap.svg +++ b/tests/kicad-parity/__snapshots__/sot23.snap.svg @@ -1 +1 @@ -{REF}Diff: 0.19% \ No newline at end of file +{REF}Diff: 0.19% \ No newline at end of file diff --git a/tests/kicad-parity/__snapshots__/sot323.snap.svg b/tests/kicad-parity/__snapshots__/sot323.snap.svg index f0910cc9..91540cf4 100644 --- a/tests/kicad-parity/__snapshots__/sot323.snap.svg +++ b/tests/kicad-parity/__snapshots__/sot323.snap.svg @@ -1 +1 @@ -{REF}Diff: 0.27% \ No newline at end of file +{REF}Diff: 0.27% \ No newline at end of file diff --git a/tests/kicad-parity/__snapshots__/sot343.snap.svg b/tests/kicad-parity/__snapshots__/sot343.snap.svg index 6c993e48..2e5aa59d 100644 --- a/tests/kicad-parity/__snapshots__/sot343.snap.svg +++ b/tests/kicad-parity/__snapshots__/sot343.snap.svg @@ -1 +1 @@ -{REF}Diff: 0.00% \ No newline at end of file +{REF}Diff: 0.00% \ No newline at end of file diff --git a/tests/kicad-parity/__snapshots__/sot363.snap.svg b/tests/kicad-parity/__snapshots__/sot363.snap.svg index 9a595ca4..982e4dd1 100644 --- a/tests/kicad-parity/__snapshots__/sot363.snap.svg +++ b/tests/kicad-parity/__snapshots__/sot363.snap.svg @@ -1 +1 @@ -{REF}Diff: 0.24% \ No newline at end of file +{REF}Diff: 0.24% \ No newline at end of file diff --git a/tests/kicad-parity/__snapshots__/sot563.snap.svg b/tests/kicad-parity/__snapshots__/sot563.snap.svg index fcf307bf..73af0c02 100644 --- a/tests/kicad-parity/__snapshots__/sot563.snap.svg +++ b/tests/kicad-parity/__snapshots__/sot563.snap.svg @@ -1 +1 @@ -{REF}Diff: 0.00% \ No newline at end of file +{REF}Diff: 0.00% \ No newline at end of file diff --git a/tests/kicad-parity/__snapshots__/sot886.snap.svg b/tests/kicad-parity/__snapshots__/sot886.snap.svg index 539939de..26058ad1 100644 --- a/tests/kicad-parity/__snapshots__/sot886.snap.svg +++ b/tests/kicad-parity/__snapshots__/sot886.snap.svg @@ -1 +1 @@ -{REF}Diff: 0.00% \ No newline at end of file +{REF}Diff: 0.00% \ No newline at end of file diff --git a/tests/kicad-parity/__snapshots__/sot89.snap.svg b/tests/kicad-parity/__snapshots__/sot89.snap.svg index 0c945c74..2e2c205c 100644 --- a/tests/kicad-parity/__snapshots__/sot89.snap.svg +++ b/tests/kicad-parity/__snapshots__/sot89.snap.svg @@ -1 +1 @@ -{REF}Diff: 0.00% \ No newline at end of file +{REF}Diff: 0.00% \ No newline at end of file diff --git a/tests/kicad-parity/__snapshots__/sot89_5.snap.svg b/tests/kicad-parity/__snapshots__/sot89_5.snap.svg index 53ab3587..3f5428e8 100644 --- a/tests/kicad-parity/__snapshots__/sot89_5.snap.svg +++ b/tests/kicad-parity/__snapshots__/sot89_5.snap.svg @@ -1 +1 @@ -{REF}Diff: 0.00% \ No newline at end of file +{REF}Diff: 0.00% \ No newline at end of file diff --git a/tests/kicad-parity/__snapshots__/ssop10.snap.svg b/tests/kicad-parity/__snapshots__/ssop10.snap.svg index 99824de4..9b5239f4 100644 --- a/tests/kicad-parity/__snapshots__/ssop10.snap.svg +++ b/tests/kicad-parity/__snapshots__/ssop10.snap.svg @@ -1 +1 @@ -{REF}Diff: 0.00% \ No newline at end of file +{REF}Diff: 0.00% \ No newline at end of file diff --git a/tests/kicad-parity/__snapshots__/to92.snap.svg b/tests/kicad-parity/__snapshots__/to92.snap.svg index 1ac2a3b2..53325d3a 100644 --- a/tests/kicad-parity/__snapshots__/to92.snap.svg +++ b/tests/kicad-parity/__snapshots__/to92.snap.svg @@ -1 +1 @@ -{REF}Diff: 0.00% \ No newline at end of file +{REF}Diff: 0.00% \ No newline at end of file diff --git a/tests/kicad-parity/__snapshots__/to92l_parity.snap.svg b/tests/kicad-parity/__snapshots__/to92l_parity.snap.svg index 428264eb..668d7b94 100644 --- a/tests/kicad-parity/__snapshots__/to92l_parity.snap.svg +++ b/tests/kicad-parity/__snapshots__/to92l_parity.snap.svg @@ -1 +1 @@ -{REF}Diff: 0.00% \ No newline at end of file +{REF}Diff: 0.00% \ No newline at end of file diff --git a/tests/kicad-parity/__snapshots__/tqfp100.snap.svg b/tests/kicad-parity/__snapshots__/tqfp100.snap.svg index a69b5d8b..6e8b7d50 100644 --- a/tests/kicad-parity/__snapshots__/tqfp100.snap.svg +++ b/tests/kicad-parity/__snapshots__/tqfp100.snap.svg @@ -1 +1 @@ -{REF}Diff: 0.00% \ No newline at end of file +{REF}Diff: 0.00% \ No newline at end of file diff --git a/tests/kicad-parity/__snapshots__/tqfp32.snap.svg b/tests/kicad-parity/__snapshots__/tqfp32.snap.svg index b5cf2aa2..2002f1d2 100644 --- a/tests/kicad-parity/__snapshots__/tqfp32.snap.svg +++ b/tests/kicad-parity/__snapshots__/tqfp32.snap.svg @@ -1 +1 @@ -{REF}Diff: 0.00% \ No newline at end of file +{REF}Diff: 0.00% \ No newline at end of file diff --git a/tests/kicad-parity/__snapshots__/tqfp48.snap.svg b/tests/kicad-parity/__snapshots__/tqfp48.snap.svg index 9e175820..54863b15 100644 --- a/tests/kicad-parity/__snapshots__/tqfp48.snap.svg +++ b/tests/kicad-parity/__snapshots__/tqfp48.snap.svg @@ -1 +1 @@ -{REF}Diff: 0.00% \ No newline at end of file +{REF}Diff: 0.00% \ No newline at end of file diff --git a/tests/kicad-parity/__snapshots__/tqfp64.snap.svg b/tests/kicad-parity/__snapshots__/tqfp64.snap.svg index 343427a9..8751458b 100644 --- a/tests/kicad-parity/__snapshots__/tqfp64.snap.svg +++ b/tests/kicad-parity/__snapshots__/tqfp64.snap.svg @@ -1 +1 @@ -{REF}Diff: 0.00% \ No newline at end of file +{REF}Diff: 0.00% \ No newline at end of file diff --git a/tests/kicad-parity/__snapshots__/tssop10.snap.svg b/tests/kicad-parity/__snapshots__/tssop10.snap.svg index a5274029..82e637df 100644 --- a/tests/kicad-parity/__snapshots__/tssop10.snap.svg +++ b/tests/kicad-parity/__snapshots__/tssop10.snap.svg @@ -1 +1 @@ -{REF}Diff: 0.00% \ No newline at end of file +{REF}Diff: 0.00% \ No newline at end of file diff --git a/tests/pad.test.ts b/tests/pad.test.ts index 4140da77..d83144be 100644 --- a/tests/pad.test.ts +++ b/tests/pad.test.ts @@ -34,18 +34,6 @@ test("pad footprint", async () => { "text": "{REF}", "type": "pcb_silkscreen_text", }, - { - "center": { - "x": 0, - "y": 0, - }, - "height": 1.5, - "layer": "top", - "pcb_component_id": "", - "pcb_courtyard_rect_id": "pcb_courtyard_rect_1", - "type": "pcb_courtyard_rect", - "width": 2.5, - }, ] `) snapshotSoup(soup) @@ -85,18 +73,6 @@ test("pad footprint with different dimensions", async () => { "text": "{REF}", "type": "pcb_silkscreen_text", }, - { - "center": { - "x": 0, - "y": 0, - }, - "height": 2.5, - "layer": "top", - "pcb_component_id": "", - "pcb_courtyard_rect_id": "pcb_courtyard_rect_1", - "type": "pcb_courtyard_rect", - "width": 3.5, - }, ] `) snapshotSoup(soup) From 4641a428faf0e30d8553486c98d0cdca70893464 Mon Sep 17 00:00:00 2001 From: Mustafa Mulla Date: Thu, 12 Mar 2026 15:09:08 +0530 Subject: [PATCH 3/3] update --- src/helpers/passive-fn.ts | 20 +++++++++---------- .../__snapshots__/0402_metric_parity.snap.svg | 2 +- .../__snapshots__/0402_parity.snap.svg | 2 +- .../__snapshots__/0603_metric_parity.snap.svg | 2 +- .../__snapshots__/0603_parity.snap.svg | 2 +- .../__snapshots__/0805_parity.snap.svg | 2 +- .../__snapshots__/1206_parity.snap.svg | 2 +- .../__snapshots__/1210_parity.snap.svg | 2 +- .../__snapshots__/1812_parity.snap.svg | 2 +- .../__snapshots__/2010_parity.snap.svg | 2 +- .../__snapshots__/2512_parity.snap.svg | 2 +- 11 files changed, 20 insertions(+), 20 deletions(-) diff --git a/src/helpers/passive-fn.ts b/src/helpers/passive-fn.ts index 4caf3400..26ef1201 100644 --- a/src/helpers/passive-fn.ts +++ b/src/helpers/passive-fn.ts @@ -191,21 +191,21 @@ export const passive = (params: PassiveDef): AnyCircuitElement[] => { const textY = textbottom ? -ph / 2 - 0.9 : ph / 2 + 0.9 const silkscreenRefText: SilkscreenRef = silkscreenRef(0, textY, 0.2) - // courtyard must enclose body, pads, AND silkscreen outline + // IPC-7351B: courtyard must enclose body, pads, AND silkscreen outline const excess = 0.25 - const silkscreenXs = silkscreenLine.route.map((pt) => Math.abs(pt.x)) - const silkscreenYs = silkscreenLine.route.map((pt) => Math.abs(pt.y)) - const maxSilkX = Math.max(...silkscreenXs) - const maxSilkY = Math.max(...silkscreenYs) - const crtHalfW = Math.max((w ?? 0) / 2, p / 2 + pw / 2, maxSilkX) + excess - const crtHalfH = Math.max((h ?? 0) / 2, ph / 2, maxSilkY) + excess + const silkXs = silkscreenLine.route.map((pt) => pt.x) + const silkYs = silkscreenLine.route.map((pt) => pt.y) + const crtMinX = Math.min(-(w ?? 0) / 2, -(p / 2 + pw / 2), ...silkXs) - excess + const crtMaxX = Math.max((w ?? 0) / 2, p / 2 + pw / 2, ...silkXs) + excess + const crtMinY = Math.min(-(h ?? 0) / 2, -ph / 2, ...silkYs) - excess + const crtMaxY = Math.max((h ?? 0) / 2, ph / 2, ...silkYs) + excess const courtyard: PcbCourtyardRect = { type: "pcb_courtyard_rect", pcb_courtyard_rect_id: "", pcb_component_id: "", - center: { x: 0, y: 0 }, - width: crtHalfW * 2, - height: crtHalfH * 2, + center: { x: (crtMinX + crtMaxX) / 2, y: (crtMinY + crtMaxY) / 2 }, + width: crtMaxX - crtMinX, + height: crtMaxY - crtMinY, layer: "top", } diff --git a/tests/kicad-parity/__snapshots__/0402_metric_parity.snap.svg b/tests/kicad-parity/__snapshots__/0402_metric_parity.snap.svg index da948042..540d6b6e 100644 --- a/tests/kicad-parity/__snapshots__/0402_metric_parity.snap.svg +++ b/tests/kicad-parity/__snapshots__/0402_metric_parity.snap.svg @@ -1 +1 @@ -{REF}Diff: 0.00% \ No newline at end of file +{REF}Diff: 0.00% \ No newline at end of file diff --git a/tests/kicad-parity/__snapshots__/0402_parity.snap.svg b/tests/kicad-parity/__snapshots__/0402_parity.snap.svg index 5402df40..3df6d490 100644 --- a/tests/kicad-parity/__snapshots__/0402_parity.snap.svg +++ b/tests/kicad-parity/__snapshots__/0402_parity.snap.svg @@ -1 +1 @@ -{REF}Diff: 0.00% \ No newline at end of file +{REF}Diff: 0.00% \ No newline at end of file diff --git a/tests/kicad-parity/__snapshots__/0603_metric_parity.snap.svg b/tests/kicad-parity/__snapshots__/0603_metric_parity.snap.svg index 6dcb25aa..554efef4 100644 --- a/tests/kicad-parity/__snapshots__/0603_metric_parity.snap.svg +++ b/tests/kicad-parity/__snapshots__/0603_metric_parity.snap.svg @@ -1 +1 @@ -{REF}Diff: 0.00% \ No newline at end of file +{REF}Diff: 0.00% \ No newline at end of file diff --git a/tests/kicad-parity/__snapshots__/0603_parity.snap.svg b/tests/kicad-parity/__snapshots__/0603_parity.snap.svg index 95b8ca3c..fd46a0d4 100644 --- a/tests/kicad-parity/__snapshots__/0603_parity.snap.svg +++ b/tests/kicad-parity/__snapshots__/0603_parity.snap.svg @@ -1 +1 @@ -{REF}Diff: 0.00% \ No newline at end of file +{REF}Diff: 0.00% \ No newline at end of file diff --git a/tests/kicad-parity/__snapshots__/0805_parity.snap.svg b/tests/kicad-parity/__snapshots__/0805_parity.snap.svg index 1953ba2d..8ec19183 100644 --- a/tests/kicad-parity/__snapshots__/0805_parity.snap.svg +++ b/tests/kicad-parity/__snapshots__/0805_parity.snap.svg @@ -1 +1 @@ -{REF}Diff: 0.00% \ No newline at end of file +{REF}Diff: 0.00% \ No newline at end of file diff --git a/tests/kicad-parity/__snapshots__/1206_parity.snap.svg b/tests/kicad-parity/__snapshots__/1206_parity.snap.svg index 69867e52..7fa1fdf5 100644 --- a/tests/kicad-parity/__snapshots__/1206_parity.snap.svg +++ b/tests/kicad-parity/__snapshots__/1206_parity.snap.svg @@ -1 +1 @@ -{REF}Diff: 0.00% \ No newline at end of file +{REF}Diff: 0.00% \ No newline at end of file diff --git a/tests/kicad-parity/__snapshots__/1210_parity.snap.svg b/tests/kicad-parity/__snapshots__/1210_parity.snap.svg index ffb285de..058f9d27 100644 --- a/tests/kicad-parity/__snapshots__/1210_parity.snap.svg +++ b/tests/kicad-parity/__snapshots__/1210_parity.snap.svg @@ -1 +1 @@ -{REF}Diff: 0.00% \ No newline at end of file +{REF}Diff: 0.00% \ No newline at end of file diff --git a/tests/kicad-parity/__snapshots__/1812_parity.snap.svg b/tests/kicad-parity/__snapshots__/1812_parity.snap.svg index d97664ea..7cbf5799 100644 --- a/tests/kicad-parity/__snapshots__/1812_parity.snap.svg +++ b/tests/kicad-parity/__snapshots__/1812_parity.snap.svg @@ -1 +1 @@ -{REF}Diff: 0.00% \ No newline at end of file +{REF}Diff: 0.00% \ No newline at end of file diff --git a/tests/kicad-parity/__snapshots__/2010_parity.snap.svg b/tests/kicad-parity/__snapshots__/2010_parity.snap.svg index 6ced7683..b3559627 100644 --- a/tests/kicad-parity/__snapshots__/2010_parity.snap.svg +++ b/tests/kicad-parity/__snapshots__/2010_parity.snap.svg @@ -1 +1 @@ -{REF}Diff: 0.00% \ No newline at end of file +{REF}Diff: 0.00% \ No newline at end of file diff --git a/tests/kicad-parity/__snapshots__/2512_parity.snap.svg b/tests/kicad-parity/__snapshots__/2512_parity.snap.svg index e9151a76..10fd0b08 100644 --- a/tests/kicad-parity/__snapshots__/2512_parity.snap.svg +++ b/tests/kicad-parity/__snapshots__/2512_parity.snap.svg @@ -1 +1 @@ -{REF}Diff: 0.00% \ No newline at end of file +{REF}Diff: 0.00% \ No newline at end of file