@tscircuit/props 0.0.681 → 0.0.682
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 +5 -1
- package/dist/index.d.ts +52 -2
- package/dist/index.js +10 -0
- package/dist/index.js.map +1 -1
- package/lib/components/copper-pour.ts +40 -21
- package/package.json +1 -1
|
@@ -9,10 +9,14 @@ export interface CopperPourProps {
|
|
|
9
9
|
layer: LayerRefInput
|
|
10
10
|
connectsTo: string
|
|
11
11
|
/**
|
|
12
|
-
* Fill with a 45-degree crosshatch (0.25mm copper width, 1mm pitch).
|
|
12
|
+
* Fill with a 45-degree crosshatch (defaults: 0.25mm copper width, 1mm pitch).
|
|
13
13
|
* Preserves solid copper around boundaries and connections. Defaults to false.
|
|
14
14
|
*/
|
|
15
15
|
crosshatch?: boolean
|
|
16
|
+
/** Repeat spacing perpendicular to the hatch strips. Defaults to 1mm when crosshatch is enabled. */
|
|
17
|
+
crosshatchPitch?: Distance
|
|
18
|
+
/** Copper strip width, also used for the solid rim. Defaults to 0.25mm; must be less than the pitch when crosshatch is enabled. */
|
|
19
|
+
crosshatchWidth?: Distance
|
|
16
20
|
/**
|
|
17
21
|
* Reserves the pour region during autorouting so unrelated traces do not
|
|
18
22
|
* split it. Vias may still cross the region using antipads.
|
|
@@ -28,26 +32,41 @@ export interface CopperPourProps {
|
|
|
28
32
|
coveredWithSolderMask?: boolean
|
|
29
33
|
}
|
|
30
34
|
|
|
31
|
-
export const copperPourProps = z
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
.
|
|
38
|
-
.optional()
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
35
|
+
export const copperPourProps = z
|
|
36
|
+
.object({
|
|
37
|
+
name: z.string().optional(),
|
|
38
|
+
layer: layer_ref,
|
|
39
|
+
connectsTo: z.string(),
|
|
40
|
+
crosshatch: z.boolean().optional(),
|
|
41
|
+
crosshatchPitch: distance.pipe(z.number().finite().positive()).optional(),
|
|
42
|
+
crosshatchWidth: distance.pipe(z.number().finite().positive()).optional(),
|
|
43
|
+
unbroken: z
|
|
44
|
+
.boolean()
|
|
45
|
+
.optional()
|
|
46
|
+
.describe(
|
|
47
|
+
"Reserves the pour region during autorouting so unrelated traces do not split it. Vias may still cross the region using antipads.",
|
|
48
|
+
),
|
|
49
|
+
padMargin: distance.optional(),
|
|
50
|
+
traceMargin: distance.optional(),
|
|
51
|
+
clearance: distance.optional(),
|
|
52
|
+
boardEdgeMargin: distance.optional(),
|
|
53
|
+
cutoutMargin: distance.optional(),
|
|
54
|
+
useThermalReliefs: z.boolean().optional(),
|
|
55
|
+
outline: z.array(point).optional(),
|
|
56
|
+
coveredWithSolderMask: z.boolean().optional().default(true),
|
|
57
|
+
})
|
|
58
|
+
.superRefine((props, ctx) => {
|
|
59
|
+
if (
|
|
60
|
+
props.crosshatch &&
|
|
61
|
+
(props.crosshatchWidth ?? 0.25) >= (props.crosshatchPitch ?? 1)
|
|
62
|
+
) {
|
|
63
|
+
ctx.addIssue({
|
|
64
|
+
code: z.ZodIssueCode.custom,
|
|
65
|
+
path: ["crosshatchWidth"],
|
|
66
|
+
message: "crosshatchWidth must be less than crosshatchPitch",
|
|
67
|
+
})
|
|
68
|
+
}
|
|
69
|
+
})
|
|
51
70
|
|
|
52
71
|
expectTypesMatch<CopperPourProps, z.input<typeof copperPourProps>>(true)
|
|
53
72
|
|