From cc347d775dd4aecfc9b264be9a6ce21010537c2e Mon Sep 17 00:00:00 2001 From: AnasSarkiz Date: Mon, 27 Jul 2026 13:57:13 +0200 Subject: [PATCH 1/2] Add via-in-pad autorouter option --- generated/COMPONENT_TYPES.md | 7 +++++++ generated/PROPS_OVERVIEW.md | 5 +++++ lib/components/group.ts | 11 +++++++++++ tests/autorouter.test.ts | 11 +++++++++++ 4 files changed, 34 insertions(+) diff --git a/generated/COMPONENT_TYPES.md b/generated/COMPONENT_TYPES.md index 0b9f15d3..4f26a8f9 100644 --- a/generated/COMPONENT_TYPES.md +++ b/generated/COMPONENT_TYPES.md @@ -2329,6 +2329,7 @@ export interface AutorouterConfig { cache?: PcbRouteCache traceClearance?: Distance availableJumperTypes?: Array<"1206x4" | "0603"> + allowViaInPad?: boolean groupMode?: | "sequential_trace" | "subcircuit" @@ -2371,6 +2372,12 @@ export const autorouterConfig = z.object({ cache: z.custom((v) => true).optional(), traceClearance: length.optional(), availableJumperTypes: z.array(z.enum(["1206x4", "0603"])).optional(), + allowViaInPad: z + .boolean() + .optional() + .describe( + "Allows the autorouter to place vias inside connected pads. Omitted or false keeps via-in-pad routing disabled.", + ), groupMode: z .enum(["sequential_trace", "subcircuit", "sequential-trace"]) .optional(), diff --git a/generated/PROPS_OVERVIEW.md b/generated/PROPS_OVERVIEW.md index a1a77650..4423b2bd 100644 --- a/generated/PROPS_OVERVIEW.md +++ b/generated/PROPS_OVERVIEW.md @@ -148,6 +148,11 @@ export interface AutorouterConfig { cache?: PcbRouteCache traceClearance?: Distance availableJumperTypes?: Array<"1206x4" | "0603"> + /** + * Allows the autorouter to place vias inside connected pads. + * Omitted or false keeps via-in-pad routing disabled. + */ + allowViaInPad?: boolean groupMode?: | "sequential_trace" | "subcircuit" diff --git a/lib/components/group.ts b/lib/components/group.ts index e08d4b17..ec9922ea 100644 --- a/lib/components/group.ts +++ b/lib/components/group.ts @@ -335,6 +335,11 @@ export interface AutorouterConfig { cache?: PcbRouteCache traceClearance?: Distance availableJumperTypes?: Array<"1206x4" | "0603"> + /** + * Allows the autorouter to place vias inside connected pads. + * Omitted or false keeps via-in-pad routing disabled. + */ + allowViaInPad?: boolean groupMode?: | "sequential_trace" | "subcircuit" @@ -404,6 +409,12 @@ export const autorouterConfig = z.object({ cache: z.custom((v) => true).optional(), traceClearance: length.optional(), availableJumperTypes: z.array(z.enum(["1206x4", "0603"])).optional(), + allowViaInPad: z + .boolean() + .optional() + .describe( + "Allows the autorouter to place vias inside connected pads. Omitted or false keeps via-in-pad routing disabled.", + ), groupMode: z .enum(["sequential_trace", "subcircuit", "sequential-trace"]) .optional(), diff --git a/tests/autorouter.test.ts b/tests/autorouter.test.ts index a8792994..f2b1d98e 100644 --- a/tests/autorouter.test.ts +++ b/tests/autorouter.test.ts @@ -1,8 +1,10 @@ import { expect, test } from "bun:test" import { + autorouterConfig, autorouterProp, routingTolerances, subcircuitGroupPropsWithBool, + type AutorouterConfig, type RoutingTolerances, } from "../lib/components/group" @@ -29,6 +31,15 @@ test("supports auto jumper preset", () => { expect(result).toBe("auto_jumper") }) +test("supports opting in to via-in-pad routing", () => { + const enabled: AutorouterConfig = { allowViaInPad: true } + const disabled: AutorouterConfig = { allowViaInPad: false } + + expect(autorouterConfig.parse(enabled).allowViaInPad).toBe(true) + expect(autorouterConfig.parse(disabled).allowViaInPad).toBe(false) + expect(autorouterConfig.parse({}).allowViaInPad).toBeUndefined() +}) + test("supports laser prefab preset", () => { const result = autorouterProp.parse("laser_prefab") expect(result).toBe("laser_prefab") From da65fbb1bcc03b3c78ea6ea3cb96c3cae91d23c6 Mon Sep 17 00:00:00 2001 From: AnasSarkiz Date: Mon, 27 Jul 2026 14:18:20 +0200 Subject: [PATCH 2/2] Remove redundant prop comment --- generated/PROPS_OVERVIEW.md | 4 ---- lib/components/group.ts | 4 ---- 2 files changed, 8 deletions(-) diff --git a/generated/PROPS_OVERVIEW.md b/generated/PROPS_OVERVIEW.md index 4423b2bd..14f9ddf4 100644 --- a/generated/PROPS_OVERVIEW.md +++ b/generated/PROPS_OVERVIEW.md @@ -148,10 +148,6 @@ export interface AutorouterConfig { cache?: PcbRouteCache traceClearance?: Distance availableJumperTypes?: Array<"1206x4" | "0603"> - /** - * Allows the autorouter to place vias inside connected pads. - * Omitted or false keeps via-in-pad routing disabled. - */ allowViaInPad?: boolean groupMode?: | "sequential_trace" diff --git a/lib/components/group.ts b/lib/components/group.ts index ec9922ea..bcd26477 100644 --- a/lib/components/group.ts +++ b/lib/components/group.ts @@ -335,10 +335,6 @@ export interface AutorouterConfig { cache?: PcbRouteCache traceClearance?: Distance availableJumperTypes?: Array<"1206x4" | "0603"> - /** - * Allows the autorouter to place vias inside connected pads. - * Omitted or false keeps via-in-pad routing disabled. - */ allowViaInPad?: boolean groupMode?: | "sequential_trace"