@tscircuit/props 0.0.675 → 0.0.677
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +11 -0
- package/dist/index.d.ts +499 -11
- package/dist/index.js +836 -797
- package/dist/index.js.map +1 -1
- package/lib/components/group.ts +8 -15
- package/lib/components/pcb-soldermask-opening.ts +56 -0
- package/lib/index.ts +1 -0
- package/package.json +1 -1
package/lib/components/group.ts
CHANGED
|
@@ -352,9 +352,9 @@ export interface AutorouterConfig {
|
|
|
352
352
|
/** Override the solver used to place implicit breakout points. */
|
|
353
353
|
implicitBreakoutPointSolverFn?: ImplicitBreakoutPointSolverFn
|
|
354
354
|
/**
|
|
355
|
-
*
|
|
356
|
-
*
|
|
357
|
-
* conflicting fields
|
|
355
|
+
* single_layer_routing is an alias that parses as bus_lanes.
|
|
356
|
+
* Replaces single_layer_bus and single_layer_buses. Omitted leaves the preset
|
|
357
|
+
* unset; other presets remain unchanged and no conflicting fields are introduced.
|
|
358
358
|
*/
|
|
359
359
|
preset?:
|
|
360
360
|
| /** @deprecated Disabled by default in core. Use the default autorouter with <autoroutingphase /> or <fanout /> as needed. Legacy support requires platformConfig.allowLegacyAutorouters: true. */ "sequential_trace"
|
|
@@ -373,8 +373,7 @@ export interface AutorouterConfig {
|
|
|
373
373
|
| "fanout"
|
|
374
374
|
| "dogbone"
|
|
375
375
|
| "bus_lanes"
|
|
376
|
-
| "
|
|
377
|
-
| "single_layer_buses"
|
|
376
|
+
| "single_layer_routing"
|
|
378
377
|
| /** @deprecated Use "auto_jumper" */ "auto-jumper"
|
|
379
378
|
| /** @deprecated Disabled by default in core. Use the default autorouter with <autoroutingphase /> or <fanout /> as needed. Legacy support requires platformConfig.allowLegacyAutorouters: true. */ "sequential-trace"
|
|
380
379
|
| /** @deprecated Use "auto_local" */ "auto-local"
|
|
@@ -400,9 +399,7 @@ export type AutorouterPreset =
|
|
|
400
399
|
| "dogbone"
|
|
401
400
|
| "bus_lanes"
|
|
402
401
|
/** Alias for bus_lanes; parsing normalizes to bus_lanes. */
|
|
403
|
-
| "
|
|
404
|
-
/** Alias for bus_lanes; parsing normalizes to bus_lanes. */
|
|
405
|
-
| "single_layer_buses"
|
|
402
|
+
| "single_layer_routing"
|
|
406
403
|
| "auto-jumper"
|
|
407
404
|
| /** @deprecated Disabled by default in core. Use the default autorouter with <autoroutingphase /> or <fanout /> as needed. Legacy support requires platformConfig.allowLegacyAutorouters: true. */ "sequential-trace"
|
|
408
405
|
| "auto-local"
|
|
@@ -478,17 +475,14 @@ export const autorouterConfig = z.object({
|
|
|
478
475
|
"fanout",
|
|
479
476
|
"dogbone",
|
|
480
477
|
"bus_lanes",
|
|
481
|
-
"
|
|
482
|
-
"single_layer_buses",
|
|
478
|
+
"single_layer_routing",
|
|
483
479
|
"auto-jumper",
|
|
484
480
|
"sequential-trace",
|
|
485
481
|
"auto-local",
|
|
486
482
|
"auto-cloud",
|
|
487
483
|
])
|
|
488
484
|
.transform((preset) =>
|
|
489
|
-
preset === "
|
|
490
|
-
? "bus_lanes"
|
|
491
|
-
: preset,
|
|
485
|
+
preset === "single_layer_routing" ? "bus_lanes" : preset,
|
|
492
486
|
)
|
|
493
487
|
.optional(),
|
|
494
488
|
local: z.boolean().optional(),
|
|
@@ -511,8 +505,7 @@ export const autorouterPreset = z.union([
|
|
|
511
505
|
z.literal("fanout"),
|
|
512
506
|
z.literal("dogbone"),
|
|
513
507
|
z.literal("bus_lanes"),
|
|
514
|
-
z.literal("
|
|
515
|
-
z.literal("single_layer_buses").transform(() => "bus_lanes" as const),
|
|
508
|
+
z.literal("single_layer_routing").transform(() => "bus_lanes" as const),
|
|
516
509
|
z.literal("auto-jumper"),
|
|
517
510
|
z.literal("sequential-trace"),
|
|
518
511
|
z.literal("auto-local"),
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { distance } from "lib/common/distance"
|
|
2
|
+
import { pcbLayoutProps } from "lib/common/layout"
|
|
3
|
+
import { z } from "zod"
|
|
4
|
+
|
|
5
|
+
const finiteDistance = distance.pipe(z.number().finite())
|
|
6
|
+
const positiveDistance = distance.pipe(z.number().finite().positive())
|
|
7
|
+
const openingBaseProps = pcbLayoutProps.omit({ layer: true }).extend({
|
|
8
|
+
name: z.string().optional(),
|
|
9
|
+
/** Face whose solder mask or flex coverlay is removed. Required. */
|
|
10
|
+
layer: z.enum(["top", "bottom"]),
|
|
11
|
+
})
|
|
12
|
+
|
|
13
|
+
export const pcbSoldermaskOpeningProps = z.discriminatedUnion("shape", [
|
|
14
|
+
openingBaseProps.extend({
|
|
15
|
+
shape: z.literal("rect"),
|
|
16
|
+
width: positiveDistance,
|
|
17
|
+
height: positiveDistance,
|
|
18
|
+
radius: z.never().optional(),
|
|
19
|
+
points: z.never().optional(),
|
|
20
|
+
}),
|
|
21
|
+
openingBaseProps.extend({
|
|
22
|
+
shape: z.literal("circle"),
|
|
23
|
+
radius: positiveDistance,
|
|
24
|
+
width: z.never().optional(),
|
|
25
|
+
height: z.never().optional(),
|
|
26
|
+
points: z.never().optional(),
|
|
27
|
+
}),
|
|
28
|
+
openingBaseProps.extend({
|
|
29
|
+
shape: z.literal("polygon"),
|
|
30
|
+
/** Local vertices; pcbX/pcbY/pcbRotation place the implicitly closed boundary. */
|
|
31
|
+
points: z
|
|
32
|
+
.array(z.object({ x: finiteDistance, y: finiteDistance }))
|
|
33
|
+
.min(3)
|
|
34
|
+
.refine((points) => {
|
|
35
|
+
const twiceArea = points.reduce((sum, point, index) => {
|
|
36
|
+
const next = points[(index + 1) % points.length]!
|
|
37
|
+
return sum + point.x * next.y - next.x * point.y
|
|
38
|
+
}, 0)
|
|
39
|
+
return Number.isFinite(twiceArea) && twiceArea !== 0
|
|
40
|
+
}, "Solder-mask opening must enclose a nonzero area"),
|
|
41
|
+
width: z.never().optional(),
|
|
42
|
+
height: z.never().optional(),
|
|
43
|
+
radius: z.never().optional(),
|
|
44
|
+
}),
|
|
45
|
+
])
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* A solder-mask or flex-coverlay aperture independent of pads and holes.
|
|
49
|
+
* Exposes underlying copper or substrate without adding copper, paste, or connectivity.
|
|
50
|
+
* Geometry is local to its parent, in mm (+X right, +Y top); use pcbRotation for rectangles.
|
|
51
|
+
*/
|
|
52
|
+
export type PcbSoldermaskOpeningProps = z.input<
|
|
53
|
+
typeof pcbSoldermaskOpeningProps
|
|
54
|
+
>
|
|
55
|
+
|
|
56
|
+
export type PcbSoldermaskOpeningPropsInput = PcbSoldermaskOpeningProps
|
package/lib/index.ts
CHANGED
|
@@ -28,6 +28,7 @@ export * from "./customDrc"
|
|
|
28
28
|
|
|
29
29
|
export * from "./components/board"
|
|
30
30
|
export * from "./components/pcb-bend"
|
|
31
|
+
export * from "./components/pcb-soldermask-opening"
|
|
31
32
|
export * from "./components/pcb-stiffener"
|
|
32
33
|
export * from "./components/panel"
|
|
33
34
|
export * from "./components/subpanel"
|