@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.
@@ -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.object({
32
- name: z.string().optional(),
33
- layer: layer_ref,
34
- connectsTo: z.string(),
35
- crosshatch: z.boolean().optional(),
36
- unbroken: z
37
- .boolean()
38
- .optional()
39
- .describe(
40
- "Reserves the pour region during autorouting so unrelated traces do not split it. Vias may still cross the region using antipads.",
41
- ),
42
- padMargin: distance.optional(),
43
- traceMargin: distance.optional(),
44
- clearance: distance.optional(),
45
- boardEdgeMargin: distance.optional(),
46
- cutoutMargin: distance.optional(),
47
- useThermalReliefs: z.boolean().optional(),
48
- outline: z.array(point).optional(),
49
- coveredWithSolderMask: z.boolean().optional().default(true),
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
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tscircuit/props",
3
- "version": "0.0.681",
3
+ "version": "0.0.682",
4
4
  "description": "Props for tscircuit builtin component types",
5
5
  "main": "dist/index.js",
6
6
  "type": "module",