Skip to content
Merged
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
7 changes: 7 additions & 0 deletions generated/COMPONENT_TYPES.md
Original file line number Diff line number Diff line change
Expand Up @@ -2329,6 +2329,7 @@ export interface AutorouterConfig {
cache?: PcbRouteCache
traceClearance?: Distance
availableJumperTypes?: Array<"1206x4" | "0603">
allowViaInPad?: boolean
groupMode?:
| "sequential_trace"
| "subcircuit"
Expand Down Expand Up @@ -2371,6 +2372,12 @@ export const autorouterConfig = z.object({
cache: z.custom<PcbRouteCache>((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(),
Expand Down
1 change: 1 addition & 0 deletions generated/PROPS_OVERVIEW.md
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ export interface AutorouterConfig {
cache?: PcbRouteCache
traceClearance?: Distance
availableJumperTypes?: Array<"1206x4" | "0603">
allowViaInPad?: boolean
groupMode?:
| "sequential_trace"
| "subcircuit"
Expand Down
7 changes: 7 additions & 0 deletions lib/components/group.ts
Original file line number Diff line number Diff line change
Expand Up @@ -335,6 +335,7 @@ export interface AutorouterConfig {
cache?: PcbRouteCache
traceClearance?: Distance
availableJumperTypes?: Array<"1206x4" | "0603">
allowViaInPad?: boolean
groupMode?:
| "sequential_trace"
| "subcircuit"
Expand Down Expand Up @@ -404,6 +405,12 @@ export const autorouterConfig = z.object({
cache: z.custom<PcbRouteCache>((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(),
Expand Down
11 changes: 11 additions & 0 deletions tests/autorouter.test.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import { expect, test } from "bun:test"
import {
autorouterConfig,
autorouterProp,
routingTolerances,
subcircuitGroupPropsWithBool,
type AutorouterConfig,
type RoutingTolerances,
} from "../lib/components/group"

Expand All @@ -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")
Expand Down
Loading