@tscircuit/core 0.0.852 → 0.0.854
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/dist/index.d.ts +118 -0
- package/dist/index.js +59 -10
- package/package.json +4 -4
package/dist/index.d.ts
CHANGED
|
@@ -21148,6 +21148,124 @@ declare class Hole extends PrimitiveComponent<typeof holeProps> {
|
|
|
21148
21148
|
pcbRelative?: boolean | undefined;
|
|
21149
21149
|
relative?: boolean | undefined;
|
|
21150
21150
|
name?: string | undefined;
|
|
21151
|
+
}>, zod.ZodObject<{
|
|
21152
|
+
pcbX: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>>;
|
|
21153
|
+
pcbY: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>>;
|
|
21154
|
+
pcbOffsetX: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>>;
|
|
21155
|
+
pcbOffsetY: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>>;
|
|
21156
|
+
pcbRotation: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>>;
|
|
21157
|
+
pcbPositionAnchor: zod.ZodOptional<zod.ZodString>;
|
|
21158
|
+
pcbPositionMode: zod.ZodOptional<zod.ZodEnum<["relative_to_group_anchor", "auto", "relative_to_board_anchor", "relative_to_component_anchor"]>>;
|
|
21159
|
+
layer: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodEnum<["top", "bottom", "inner1", "inner2", "inner3", "inner4", "inner5", "inner6"]>, zod.ZodObject<{
|
|
21160
|
+
name: zod.ZodEnum<["top", "bottom", "inner1", "inner2", "inner3", "inner4", "inner5", "inner6"]>;
|
|
21161
|
+
}, "strip", zod.ZodTypeAny, {
|
|
21162
|
+
name: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6";
|
|
21163
|
+
}, {
|
|
21164
|
+
name: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6";
|
|
21165
|
+
}>]>, "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6", "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6" | {
|
|
21166
|
+
name: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6";
|
|
21167
|
+
}>>;
|
|
21168
|
+
pcbMarginTop: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>>;
|
|
21169
|
+
pcbMarginRight: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>>;
|
|
21170
|
+
pcbMarginBottom: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>>;
|
|
21171
|
+
pcbMarginLeft: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>>;
|
|
21172
|
+
pcbMarginX: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>>;
|
|
21173
|
+
pcbMarginY: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>>;
|
|
21174
|
+
pcbStyle: zod.ZodOptional<zod.ZodObject<{
|
|
21175
|
+
silkscreenFontSize: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>>;
|
|
21176
|
+
silkscreenTextPosition: zod.ZodOptional<zod.ZodUnion<[zod.ZodEnum<["centered", "outside", "none"]>, zod.ZodObject<{
|
|
21177
|
+
offsetX: zod.ZodNumber;
|
|
21178
|
+
offsetY: zod.ZodNumber;
|
|
21179
|
+
}, "strip", zod.ZodTypeAny, {
|
|
21180
|
+
offsetX: number;
|
|
21181
|
+
offsetY: number;
|
|
21182
|
+
}, {
|
|
21183
|
+
offsetX: number;
|
|
21184
|
+
offsetY: number;
|
|
21185
|
+
}>]>>;
|
|
21186
|
+
silkscreenTextVisibility: zod.ZodOptional<zod.ZodEnum<["hidden", "visible", "inherit"]>>;
|
|
21187
|
+
}, "strip", zod.ZodTypeAny, {
|
|
21188
|
+
silkscreenFontSize?: number | undefined;
|
|
21189
|
+
silkscreenTextPosition?: "centered" | "outside" | "none" | {
|
|
21190
|
+
offsetX: number;
|
|
21191
|
+
offsetY: number;
|
|
21192
|
+
} | undefined;
|
|
21193
|
+
silkscreenTextVisibility?: "hidden" | "visible" | "inherit" | undefined;
|
|
21194
|
+
}, {
|
|
21195
|
+
silkscreenFontSize?: string | number | undefined;
|
|
21196
|
+
silkscreenTextPosition?: "centered" | "outside" | "none" | {
|
|
21197
|
+
offsetX: number;
|
|
21198
|
+
offsetY: number;
|
|
21199
|
+
} | undefined;
|
|
21200
|
+
silkscreenTextVisibility?: "hidden" | "visible" | "inherit" | undefined;
|
|
21201
|
+
}>>;
|
|
21202
|
+
pcbRelative: zod.ZodOptional<zod.ZodBoolean>;
|
|
21203
|
+
relative: zod.ZodOptional<zod.ZodBoolean>;
|
|
21204
|
+
} & {
|
|
21205
|
+
name: zod.ZodOptional<zod.ZodString>;
|
|
21206
|
+
shape: zod.ZodLiteral<"rect">;
|
|
21207
|
+
width: zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>;
|
|
21208
|
+
height: zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>;
|
|
21209
|
+
}, "strip", zod.ZodTypeAny, {
|
|
21210
|
+
shape: "rect";
|
|
21211
|
+
width: number;
|
|
21212
|
+
height: number;
|
|
21213
|
+
pcbX?: number | undefined;
|
|
21214
|
+
pcbY?: number | undefined;
|
|
21215
|
+
pcbOffsetX?: number | undefined;
|
|
21216
|
+
pcbOffsetY?: number | undefined;
|
|
21217
|
+
pcbRotation?: number | undefined;
|
|
21218
|
+
pcbPositionAnchor?: string | undefined;
|
|
21219
|
+
pcbPositionMode?: "relative_to_group_anchor" | "auto" | "relative_to_board_anchor" | "relative_to_component_anchor" | undefined;
|
|
21220
|
+
layer?: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6" | undefined;
|
|
21221
|
+
pcbMarginTop?: number | undefined;
|
|
21222
|
+
pcbMarginRight?: number | undefined;
|
|
21223
|
+
pcbMarginBottom?: number | undefined;
|
|
21224
|
+
pcbMarginLeft?: number | undefined;
|
|
21225
|
+
pcbMarginX?: number | undefined;
|
|
21226
|
+
pcbMarginY?: number | undefined;
|
|
21227
|
+
pcbStyle?: {
|
|
21228
|
+
silkscreenFontSize?: number | undefined;
|
|
21229
|
+
silkscreenTextPosition?: "centered" | "outside" | "none" | {
|
|
21230
|
+
offsetX: number;
|
|
21231
|
+
offsetY: number;
|
|
21232
|
+
} | undefined;
|
|
21233
|
+
silkscreenTextVisibility?: "hidden" | "visible" | "inherit" | undefined;
|
|
21234
|
+
} | undefined;
|
|
21235
|
+
pcbRelative?: boolean | undefined;
|
|
21236
|
+
relative?: boolean | undefined;
|
|
21237
|
+
name?: string | undefined;
|
|
21238
|
+
}, {
|
|
21239
|
+
shape: "rect";
|
|
21240
|
+
width: string | number;
|
|
21241
|
+
height: string | number;
|
|
21242
|
+
pcbX?: string | number | undefined;
|
|
21243
|
+
pcbY?: string | number | undefined;
|
|
21244
|
+
pcbOffsetX?: string | number | undefined;
|
|
21245
|
+
pcbOffsetY?: string | number | undefined;
|
|
21246
|
+
pcbRotation?: string | number | undefined;
|
|
21247
|
+
pcbPositionAnchor?: string | undefined;
|
|
21248
|
+
pcbPositionMode?: "relative_to_group_anchor" | "auto" | "relative_to_board_anchor" | "relative_to_component_anchor" | undefined;
|
|
21249
|
+
layer?: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6" | {
|
|
21250
|
+
name: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6";
|
|
21251
|
+
} | undefined;
|
|
21252
|
+
pcbMarginTop?: string | number | undefined;
|
|
21253
|
+
pcbMarginRight?: string | number | undefined;
|
|
21254
|
+
pcbMarginBottom?: string | number | undefined;
|
|
21255
|
+
pcbMarginLeft?: string | number | undefined;
|
|
21256
|
+
pcbMarginX?: string | number | undefined;
|
|
21257
|
+
pcbMarginY?: string | number | undefined;
|
|
21258
|
+
pcbStyle?: {
|
|
21259
|
+
silkscreenFontSize?: string | number | undefined;
|
|
21260
|
+
silkscreenTextPosition?: "centered" | "outside" | "none" | {
|
|
21261
|
+
offsetX: number;
|
|
21262
|
+
offsetY: number;
|
|
21263
|
+
} | undefined;
|
|
21264
|
+
silkscreenTextVisibility?: "hidden" | "visible" | "inherit" | undefined;
|
|
21265
|
+
} | undefined;
|
|
21266
|
+
pcbRelative?: boolean | undefined;
|
|
21267
|
+
relative?: boolean | undefined;
|
|
21268
|
+
name?: string | undefined;
|
|
21151
21269
|
}>]>;
|
|
21152
21270
|
};
|
|
21153
21271
|
getPcbSize(): {
|
package/dist/index.js
CHANGED
|
@@ -2701,10 +2701,23 @@ var Hole = class extends PrimitiveComponent2 {
|
|
|
2701
2701
|
getPcbSize() {
|
|
2702
2702
|
const { _parsedProps: props } = this;
|
|
2703
2703
|
const isPill = props.shape === "pill";
|
|
2704
|
-
|
|
2705
|
-
|
|
2706
|
-
|
|
2707
|
-
|
|
2704
|
+
const isRect = props.shape === "rect";
|
|
2705
|
+
if (isPill) {
|
|
2706
|
+
return {
|
|
2707
|
+
width: props.width,
|
|
2708
|
+
height: props.height
|
|
2709
|
+
};
|
|
2710
|
+
} else if (isRect) {
|
|
2711
|
+
return {
|
|
2712
|
+
width: props.width,
|
|
2713
|
+
height: props.height
|
|
2714
|
+
};
|
|
2715
|
+
} else {
|
|
2716
|
+
return {
|
|
2717
|
+
width: props.diameter,
|
|
2718
|
+
height: props.diameter
|
|
2719
|
+
};
|
|
2720
|
+
}
|
|
2708
2721
|
}
|
|
2709
2722
|
doInitialPcbPrimitiveRender() {
|
|
2710
2723
|
if (this.root?.pcbDisabled) return;
|
|
@@ -2739,10 +2752,22 @@ var Hole = class extends PrimitiveComponent2 {
|
|
|
2739
2752
|
});
|
|
2740
2753
|
this.pcb_hole_id = inserted_hole.pcb_hole_id;
|
|
2741
2754
|
}
|
|
2755
|
+
} else if (props.shape === "rect") {
|
|
2756
|
+
const inserted_hole = db.pcb_hole.insert({
|
|
2757
|
+
type: "pcb_hole",
|
|
2758
|
+
hole_shape: "rect",
|
|
2759
|
+
hole_width: props.width,
|
|
2760
|
+
hole_height: props.height,
|
|
2761
|
+
x: position.x,
|
|
2762
|
+
y: position.y,
|
|
2763
|
+
subcircuit_id: subcircuit?.subcircuit_id ?? void 0,
|
|
2764
|
+
pcb_group_id: subcircuit?.getGroup()?.pcb_group_id ?? void 0
|
|
2765
|
+
});
|
|
2766
|
+
this.pcb_hole_id = inserted_hole.pcb_hole_id;
|
|
2742
2767
|
} else {
|
|
2743
2768
|
const inserted_hole = db.pcb_hole.insert({
|
|
2769
|
+
type: "pcb_hole",
|
|
2744
2770
|
hole_shape: "circle",
|
|
2745
|
-
// @ts-ignore
|
|
2746
2771
|
hole_diameter: props.diameter,
|
|
2747
2772
|
x: position.x,
|
|
2748
2773
|
y: position.y,
|
|
@@ -3172,6 +3197,16 @@ var createComponentsFromCircuitJson = ({
|
|
|
3172
3197
|
diameter: elm.hole_diameter
|
|
3173
3198
|
})
|
|
3174
3199
|
);
|
|
3200
|
+
} else if (elm.type === "pcb_hole" && elm.hole_shape === "rect") {
|
|
3201
|
+
components.push(
|
|
3202
|
+
new Hole({
|
|
3203
|
+
pcbX: elm.x,
|
|
3204
|
+
pcbY: elm.y,
|
|
3205
|
+
shape: "rect",
|
|
3206
|
+
width: elm.hole_width,
|
|
3207
|
+
height: elm.hole_height
|
|
3208
|
+
})
|
|
3209
|
+
);
|
|
3175
3210
|
} else if (elm.type === "pcb_hole" && elm.hole_shape === "pill") {
|
|
3176
3211
|
components.push(
|
|
3177
3212
|
new Hole({
|
|
@@ -5384,6 +5419,18 @@ var getObstaclesFromCircuitJson = (soup, connMap) => {
|
|
|
5384
5419
|
height: element.hole_height,
|
|
5385
5420
|
connectedTo: []
|
|
5386
5421
|
});
|
|
5422
|
+
} else if (element.hole_shape === "rect") {
|
|
5423
|
+
obstacles.push({
|
|
5424
|
+
type: "rect",
|
|
5425
|
+
layers: EVERY_LAYER,
|
|
5426
|
+
center: {
|
|
5427
|
+
x: element.x,
|
|
5428
|
+
y: element.y
|
|
5429
|
+
},
|
|
5430
|
+
width: element.hole_width,
|
|
5431
|
+
height: element.hole_height,
|
|
5432
|
+
connectedTo: []
|
|
5433
|
+
});
|
|
5387
5434
|
} else if (element.hole_shape === "square") {
|
|
5388
5435
|
obstacles.push({
|
|
5389
5436
|
type: "rect",
|
|
@@ -16374,13 +16421,15 @@ var CopperPour = class extends PrimitiveComponent2 {
|
|
|
16374
16421
|
});
|
|
16375
16422
|
const solver = new CopperPourPipelineSolver(inputProblem);
|
|
16376
16423
|
const { brep_shapes } = solver.getOutput();
|
|
16424
|
+
const coveredWithSolderMask = props.coveredWithSolderMask ?? false;
|
|
16377
16425
|
for (const brep_shape of brep_shapes) {
|
|
16378
16426
|
db.pcb_copper_pour.insert({
|
|
16379
16427
|
shape: "brep",
|
|
16380
16428
|
layer: props.layer,
|
|
16381
16429
|
brep_shape,
|
|
16382
16430
|
source_net_id: net.source_net_id,
|
|
16383
|
-
subcircuit_id: subcircuit?.subcircuit_id ?? void 0
|
|
16431
|
+
subcircuit_id: subcircuit?.subcircuit_id ?? void 0,
|
|
16432
|
+
covered_with_solder_mask: coveredWithSolderMask
|
|
16384
16433
|
});
|
|
16385
16434
|
}
|
|
16386
16435
|
});
|
|
@@ -17625,7 +17674,7 @@ import { identity as identity6 } from "transformation-matrix";
|
|
|
17625
17674
|
var package_default = {
|
|
17626
17675
|
name: "@tscircuit/core",
|
|
17627
17676
|
type: "module",
|
|
17628
|
-
version: "0.0.
|
|
17677
|
+
version: "0.0.853",
|
|
17629
17678
|
types: "dist/index.d.ts",
|
|
17630
17679
|
main: "dist/index.js",
|
|
17631
17680
|
module: "dist/index.js",
|
|
@@ -17669,7 +17718,7 @@ var package_default = {
|
|
|
17669
17718
|
"@tscircuit/math-utils": "^0.0.29",
|
|
17670
17719
|
"@tscircuit/miniflex": "^0.0.4",
|
|
17671
17720
|
"@tscircuit/ngspice-spice-engine": "^0.0.2",
|
|
17672
|
-
"@tscircuit/props": "^0.0.
|
|
17721
|
+
"@tscircuit/props": "^0.0.397",
|
|
17673
17722
|
"@tscircuit/schematic-autolayout": "^0.0.6",
|
|
17674
17723
|
"@tscircuit/schematic-match-adapt": "^0.0.16",
|
|
17675
17724
|
"@tscircuit/schematic-trace-solver": "^v0.0.45",
|
|
@@ -17683,13 +17732,13 @@ var package_default = {
|
|
|
17683
17732
|
"bun-match-svg": "0.0.12",
|
|
17684
17733
|
"calculate-elbow": "^0.0.12",
|
|
17685
17734
|
"chokidar-cli": "^3.0.0",
|
|
17686
|
-
"circuit-json": "^0.0.
|
|
17735
|
+
"circuit-json": "^0.0.304",
|
|
17687
17736
|
"circuit-json-to-bpc": "^0.0.13",
|
|
17688
17737
|
"circuit-json-to-connectivity-map": "^0.0.22",
|
|
17689
17738
|
"circuit-json-to-gltf": "^0.0.31",
|
|
17690
17739
|
"circuit-json-to-simple-3d": "^0.0.9",
|
|
17691
17740
|
"circuit-json-to-spice": "^0.0.16",
|
|
17692
|
-
"circuit-to-svg": "^0.0.
|
|
17741
|
+
"circuit-to-svg": "^0.0.265",
|
|
17693
17742
|
concurrently: "^9.1.2",
|
|
17694
17743
|
"connectivity-map": "^1.0.0",
|
|
17695
17744
|
debug: "^4.3.6",
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tscircuit/core",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.854",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"module": "dist/index.js",
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"@tscircuit/math-utils": "^0.0.29",
|
|
46
46
|
"@tscircuit/miniflex": "^0.0.4",
|
|
47
47
|
"@tscircuit/ngspice-spice-engine": "^0.0.2",
|
|
48
|
-
"@tscircuit/props": "^0.0.
|
|
48
|
+
"@tscircuit/props": "^0.0.397",
|
|
49
49
|
"@tscircuit/schematic-autolayout": "^0.0.6",
|
|
50
50
|
"@tscircuit/schematic-match-adapt": "^0.0.16",
|
|
51
51
|
"@tscircuit/schematic-trace-solver": "^v0.0.45",
|
|
@@ -59,13 +59,13 @@
|
|
|
59
59
|
"bun-match-svg": "0.0.12",
|
|
60
60
|
"calculate-elbow": "^0.0.12",
|
|
61
61
|
"chokidar-cli": "^3.0.0",
|
|
62
|
-
"circuit-json": "^0.0.
|
|
62
|
+
"circuit-json": "^0.0.304",
|
|
63
63
|
"circuit-json-to-bpc": "^0.0.13",
|
|
64
64
|
"circuit-json-to-connectivity-map": "^0.0.22",
|
|
65
65
|
"circuit-json-to-gltf": "^0.0.31",
|
|
66
66
|
"circuit-json-to-simple-3d": "^0.0.9",
|
|
67
67
|
"circuit-json-to-spice": "^0.0.16",
|
|
68
|
-
"circuit-to-svg": "^0.0.
|
|
68
|
+
"circuit-to-svg": "^0.0.265",
|
|
69
69
|
"concurrently": "^9.1.2",
|
|
70
70
|
"connectivity-map": "^1.0.0",
|
|
71
71
|
"debug": "^4.3.6",
|