@tscircuit/core 0.0.817 → 0.0.818
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 +42 -0
- package/dist/index.js +13 -6
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -143,6 +143,7 @@ type Obstacle = {
|
|
|
143
143
|
interface SimpleRouteConnection {
|
|
144
144
|
name: string;
|
|
145
145
|
source_trace_id?: string;
|
|
146
|
+
width?: number;
|
|
146
147
|
pointsToConnect: Array<{
|
|
147
148
|
x: number;
|
|
148
149
|
y: number;
|
|
@@ -591,10 +592,15 @@ declare class Trace extends PrimitiveComponent<typeof traceProps> implements Tra
|
|
|
591
592
|
_traceConnectionHash: string | null;
|
|
592
593
|
_couldNotFindPort?: boolean;
|
|
593
594
|
constructor(props: z.input<typeof traceProps>);
|
|
595
|
+
/**
|
|
596
|
+
* Get the explicit trace thickness, supporting 'width' as an alias for 'thickness'
|
|
597
|
+
*/
|
|
598
|
+
_getExplicitTraceThickness(): number | undefined;
|
|
594
599
|
get config(): {
|
|
595
600
|
zodProps: z.ZodUnion<[z.ZodObject<{
|
|
596
601
|
key: z.ZodOptional<z.ZodString>;
|
|
597
602
|
thickness: z.ZodOptional<z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, number, string | number>>;
|
|
603
|
+
width: z.ZodOptional<z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, number, string | number>>;
|
|
598
604
|
schematicRouteHints: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
599
605
|
x: z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, number, string | number>;
|
|
600
606
|
y: z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, number, string | number>;
|
|
@@ -661,6 +667,7 @@ declare class Trace extends PrimitiveComponent<typeof traceProps> implements Tra
|
|
|
661
667
|
})[];
|
|
662
668
|
key?: string | undefined;
|
|
663
669
|
highlightColor?: string | undefined;
|
|
670
|
+
width?: number | undefined;
|
|
664
671
|
thickness?: number | undefined;
|
|
665
672
|
maxLength?: number | undefined;
|
|
666
673
|
schematicRouteHints?: {
|
|
@@ -687,6 +694,7 @@ declare class Trace extends PrimitiveComponent<typeof traceProps> implements Tra
|
|
|
687
694
|
})[];
|
|
688
695
|
key?: string | undefined;
|
|
689
696
|
highlightColor?: string | undefined;
|
|
697
|
+
width?: string | number | undefined;
|
|
690
698
|
thickness?: string | number | undefined;
|
|
691
699
|
maxLength?: string | number | undefined;
|
|
692
700
|
schematicRouteHints?: {
|
|
@@ -712,6 +720,7 @@ declare class Trace extends PrimitiveComponent<typeof traceProps> implements Tra
|
|
|
712
720
|
}>, z.ZodObject<{
|
|
713
721
|
key: z.ZodOptional<z.ZodString>;
|
|
714
722
|
thickness: z.ZodOptional<z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, number, string | number>>;
|
|
723
|
+
width: z.ZodOptional<z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, number, string | number>>;
|
|
715
724
|
schematicRouteHints: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
716
725
|
x: z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, number, string | number>;
|
|
717
726
|
y: z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, number, string | number>;
|
|
@@ -786,6 +795,7 @@ declare class Trace extends PrimitiveComponent<typeof traceProps> implements Tra
|
|
|
786
795
|
};
|
|
787
796
|
key?: string | undefined;
|
|
788
797
|
highlightColor?: string | undefined;
|
|
798
|
+
width?: number | undefined;
|
|
789
799
|
thickness?: number | undefined;
|
|
790
800
|
maxLength?: number | undefined;
|
|
791
801
|
schematicRouteHints?: {
|
|
@@ -815,6 +825,7 @@ declare class Trace extends PrimitiveComponent<typeof traceProps> implements Tra
|
|
|
815
825
|
};
|
|
816
826
|
key?: string | undefined;
|
|
817
827
|
highlightColor?: string | undefined;
|
|
828
|
+
width?: string | number | undefined;
|
|
818
829
|
thickness?: string | number | undefined;
|
|
819
830
|
maxLength?: string | number | undefined;
|
|
820
831
|
schematicRouteHints?: {
|
|
@@ -1985,6 +1996,7 @@ declare class Board extends Group<typeof boardProps> {
|
|
|
1985
1996
|
}>, "many">>;
|
|
1986
1997
|
outlineOffsetX: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>>;
|
|
1987
1998
|
outlineOffsetY: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>>;
|
|
1999
|
+
circuitJson: zod.ZodOptional<zod.ZodArray<zod.ZodAny, "many">>;
|
|
1988
2000
|
}, "connections"> & {
|
|
1989
2001
|
material: zod.ZodDefault<zod.ZodEnum<["fr4", "fr1"]>>;
|
|
1990
2002
|
layers: zod.ZodDefault<zod.ZodUnion<[zod.ZodLiteral<2>, zod.ZodLiteral<4>]>>;
|
|
@@ -2240,6 +2252,7 @@ declare class Board extends Group<typeof boardProps> {
|
|
|
2240
2252
|
minTraceWidth?: number | undefined;
|
|
2241
2253
|
pcbRouteCache?: _tscircuit_props.PcbRouteCache | undefined;
|
|
2242
2254
|
autorouter?: _tscircuit_props.AutorouterProp | undefined;
|
|
2255
|
+
circuitJson?: any[] | undefined;
|
|
2243
2256
|
schAutoLayoutEnabled?: boolean | undefined;
|
|
2244
2257
|
schTraceAutoLabelEnabled?: boolean | undefined;
|
|
2245
2258
|
schMaxTraceDistance?: number | undefined;
|
|
@@ -2537,6 +2550,7 @@ declare class Board extends Group<typeof boardProps> {
|
|
|
2537
2550
|
minTraceWidth?: string | number | undefined;
|
|
2538
2551
|
pcbRouteCache?: _tscircuit_props.PcbRouteCache | undefined;
|
|
2539
2552
|
autorouter?: _tscircuit_props.AutorouterProp | undefined;
|
|
2553
|
+
circuitJson?: any[] | undefined;
|
|
2540
2554
|
schAutoLayoutEnabled?: boolean | undefined;
|
|
2541
2555
|
schTraceAutoLabelEnabled?: boolean | undefined;
|
|
2542
2556
|
schMaxTraceDistance?: string | number | undefined;
|
|
@@ -18963,6 +18977,7 @@ declare class FabricationNoteDimension extends PrimitiveComponent<typeof fabrica
|
|
|
18963
18977
|
fontSize: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>>;
|
|
18964
18978
|
color: zod.ZodOptional<zod.ZodString>;
|
|
18965
18979
|
arrowSize: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>>;
|
|
18980
|
+
units: zod.ZodOptional<zod.ZodEnum<["in", "mm"]>>;
|
|
18966
18981
|
}, "strip", zod.ZodTypeAny, {
|
|
18967
18982
|
from: string | {
|
|
18968
18983
|
x: number;
|
|
@@ -18989,6 +19004,7 @@ declare class FabricationNoteDimension extends PrimitiveComponent<typeof fabrica
|
|
|
18989
19004
|
fontSize?: number | undefined;
|
|
18990
19005
|
offset?: number | undefined;
|
|
18991
19006
|
arrowSize?: number | undefined;
|
|
19007
|
+
units?: "in" | "mm" | undefined;
|
|
18992
19008
|
}, {
|
|
18993
19009
|
from: string | {
|
|
18994
19010
|
x: string | number;
|
|
@@ -19017,6 +19033,7 @@ declare class FabricationNoteDimension extends PrimitiveComponent<typeof fabrica
|
|
|
19017
19033
|
fontSize?: string | number | undefined;
|
|
19018
19034
|
offset?: string | number | undefined;
|
|
19019
19035
|
arrowSize?: string | number | undefined;
|
|
19036
|
+
units?: "in" | "mm" | undefined;
|
|
19020
19037
|
}>;
|
|
19021
19038
|
};
|
|
19022
19039
|
private _resolvePoint;
|
|
@@ -19475,6 +19492,7 @@ declare class PcbNoteDimension extends PrimitiveComponent<typeof pcbNoteDimensio
|
|
|
19475
19492
|
fontSize: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>>;
|
|
19476
19493
|
color: zod.ZodOptional<zod.ZodString>;
|
|
19477
19494
|
arrowSize: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>>;
|
|
19495
|
+
units: zod.ZodOptional<zod.ZodEnum<["in", "mm"]>>;
|
|
19478
19496
|
}, "strip", zod.ZodTypeAny, {
|
|
19479
19497
|
from: string | {
|
|
19480
19498
|
x: number;
|
|
@@ -19501,6 +19519,7 @@ declare class PcbNoteDimension extends PrimitiveComponent<typeof pcbNoteDimensio
|
|
|
19501
19519
|
fontSize?: number | undefined;
|
|
19502
19520
|
offset?: number | undefined;
|
|
19503
19521
|
arrowSize?: number | undefined;
|
|
19522
|
+
units?: "in" | "mm" | undefined;
|
|
19504
19523
|
}, {
|
|
19505
19524
|
from: string | {
|
|
19506
19525
|
x: string | number;
|
|
@@ -19529,6 +19548,7 @@ declare class PcbNoteDimension extends PrimitiveComponent<typeof pcbNoteDimensio
|
|
|
19529
19548
|
fontSize?: string | number | undefined;
|
|
19530
19549
|
offset?: string | number | undefined;
|
|
19531
19550
|
arrowSize?: string | number | undefined;
|
|
19551
|
+
units?: "in" | "mm" | undefined;
|
|
19532
19552
|
}>;
|
|
19533
19553
|
};
|
|
19534
19554
|
private _resolvePoint;
|
|
@@ -34729,6 +34749,13 @@ declare class TestPoint extends NormalComponent<typeof testpointProps> {
|
|
|
34729
34749
|
highlightColor?: string | undefined;
|
|
34730
34750
|
}>>>;
|
|
34731
34751
|
} & {
|
|
34752
|
+
connections: zod.ZodOptional<zod.ZodObject<{
|
|
34753
|
+
pin1: zod.ZodUnion<[zod.ZodUnion<[zod.ZodString, zod.ZodReadonly<zod.ZodArray<zod.ZodString, "many">>]>, zod.ZodArray<zod.ZodString, "many">]>;
|
|
34754
|
+
}, "strict", zod.ZodTypeAny, {
|
|
34755
|
+
pin1: string | readonly string[] | string[];
|
|
34756
|
+
}, {
|
|
34757
|
+
pin1: string | readonly string[] | string[];
|
|
34758
|
+
}>>;
|
|
34732
34759
|
footprintVariant: zod.ZodOptional<zod.ZodEnum<["pad", "through_hole"]>>;
|
|
34733
34760
|
padShape: zod.ZodDefault<zod.ZodOptional<zod.ZodEnum<["rect", "circle"]>>>;
|
|
34734
34761
|
padDiameter: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>>;
|
|
@@ -34920,6 +34947,9 @@ declare class TestPoint extends NormalComponent<typeof testpointProps> {
|
|
|
34920
34947
|
obstructsWithinBounds?: boolean | undefined;
|
|
34921
34948
|
width?: number | undefined;
|
|
34922
34949
|
height?: number | undefined;
|
|
34950
|
+
connections?: {
|
|
34951
|
+
pin1: string | readonly string[] | string[];
|
|
34952
|
+
} | undefined;
|
|
34923
34953
|
holeDiameter?: number | undefined;
|
|
34924
34954
|
footprintVariant?: "pad" | "through_hole" | undefined;
|
|
34925
34955
|
padDiameter?: number | undefined;
|
|
@@ -35109,6 +35139,9 @@ declare class TestPoint extends NormalComponent<typeof testpointProps> {
|
|
|
35109
35139
|
obstructsWithinBounds?: boolean | undefined;
|
|
35110
35140
|
width?: string | number | undefined;
|
|
35111
35141
|
height?: string | number | undefined;
|
|
35142
|
+
connections?: {
|
|
35143
|
+
pin1: string | readonly string[] | string[];
|
|
35144
|
+
} | undefined;
|
|
35112
35145
|
holeDiameter?: string | number | undefined;
|
|
35113
35146
|
padShape?: "circle" | "rect" | undefined;
|
|
35114
35147
|
footprintVariant?: "pad" | "through_hole" | undefined;
|
|
@@ -35298,6 +35331,9 @@ declare class TestPoint extends NormalComponent<typeof testpointProps> {
|
|
|
35298
35331
|
obstructsWithinBounds?: boolean | undefined;
|
|
35299
35332
|
width?: number | undefined;
|
|
35300
35333
|
height?: number | undefined;
|
|
35334
|
+
connections?: {
|
|
35335
|
+
pin1: string | readonly string[] | string[];
|
|
35336
|
+
} | undefined;
|
|
35301
35337
|
holeDiameter?: number | undefined;
|
|
35302
35338
|
footprintVariant?: "pad" | "through_hole" | undefined;
|
|
35303
35339
|
padDiameter?: number | undefined;
|
|
@@ -35487,6 +35523,9 @@ declare class TestPoint extends NormalComponent<typeof testpointProps> {
|
|
|
35487
35523
|
obstructsWithinBounds?: boolean | undefined;
|
|
35488
35524
|
width?: string | number | undefined;
|
|
35489
35525
|
height?: string | number | undefined;
|
|
35526
|
+
connections?: {
|
|
35527
|
+
pin1: string | readonly string[] | string[];
|
|
35528
|
+
} | undefined;
|
|
35490
35529
|
holeDiameter?: string | number | undefined;
|
|
35491
35530
|
padShape?: "circle" | "rect" | undefined;
|
|
35492
35531
|
footprintVariant?: "pad" | "through_hole" | undefined;
|
|
@@ -35947,14 +35986,17 @@ declare class AnalogSimulation extends PrimitiveComponent<typeof analogSimulatio
|
|
|
35947
35986
|
simulationType: z.ZodDefault<z.ZodLiteral<"spice_transient_analysis">>;
|
|
35948
35987
|
duration: z.ZodOptional<z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, number, string | number>>;
|
|
35949
35988
|
timePerStep: z.ZodOptional<z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, number, string | number>>;
|
|
35989
|
+
spiceEngine: z.ZodOptional<z.ZodType<_tscircuit_props.AutocompleteString<"spicey" | "ngspice">, z.ZodTypeDef, _tscircuit_props.AutocompleteString<"spicey" | "ngspice">>>;
|
|
35950
35990
|
}, "strip", z.ZodTypeAny, {
|
|
35951
35991
|
simulationType: "spice_transient_analysis";
|
|
35952
35992
|
duration?: number | undefined;
|
|
35953
35993
|
timePerStep?: number | undefined;
|
|
35994
|
+
spiceEngine?: _tscircuit_props.AutocompleteString<"spicey" | "ngspice"> | undefined;
|
|
35954
35995
|
}, {
|
|
35955
35996
|
duration?: string | number | undefined;
|
|
35956
35997
|
simulationType?: "spice_transient_analysis" | undefined;
|
|
35957
35998
|
timePerStep?: string | number | undefined;
|
|
35999
|
+
spiceEngine?: _tscircuit_props.AutocompleteString<"spicey" | "ngspice"> | undefined;
|
|
35958
36000
|
}>;
|
|
35959
36001
|
};
|
|
35960
36002
|
doInitialSimulationRender(): void;
|
package/dist/index.js
CHANGED
|
@@ -6306,7 +6306,7 @@ function Trace_doInitialPcbTraceRender(trace) {
|
|
|
6306
6306
|
const bLayer = "layers" in b && b.layers.length === 1 ? b.layers[0] : dominantLayer ?? "top";
|
|
6307
6307
|
const pcbPortA = "pcb_port_id" in a ? a.pcb_port_id : null;
|
|
6308
6308
|
const pcbPortB = "pcb_port_id" in b ? b.pcb_port_id : null;
|
|
6309
|
-
const minTraceWidth = trace.getSubcircuit()._parsedProps.minTraceWidth ?? 0.16;
|
|
6309
|
+
const minTraceWidth = trace._getExplicitTraceThickness() ?? trace.getSubcircuit()._parsedProps.minTraceWidth ?? 0.16;
|
|
6310
6310
|
const ijump = new MultilayerIjump2({
|
|
6311
6311
|
OBSTACLE_MARGIN: minTraceWidth * 2,
|
|
6312
6312
|
isRemovePathLoopsEnabled: true,
|
|
@@ -6416,7 +6416,7 @@ function Trace_doInitialPcbManualTraceRender(trace) {
|
|
|
6416
6416
|
const { db } = trace.root;
|
|
6417
6417
|
const { _parsedProps: props } = trace;
|
|
6418
6418
|
const subcircuit = trace.getSubcircuit();
|
|
6419
|
-
if (!props.pcbPath
|
|
6419
|
+
if (!props.pcbPath) return;
|
|
6420
6420
|
const { allPortsFound, ports, portsWithSelectors } = trace._findConnectedPorts();
|
|
6421
6421
|
if (!allPortsFound) return;
|
|
6422
6422
|
const portsWithoutMatchedPcbPrimitive = [];
|
|
@@ -6450,7 +6450,7 @@ function Trace_doInitialPcbManualTraceRender(trace) {
|
|
|
6450
6450
|
}
|
|
6451
6451
|
const otherPort = ports.find((p) => p !== anchorPort) ?? ports[1];
|
|
6452
6452
|
const layer = anchorPort.getAvailablePcbLayers()[0] || "top";
|
|
6453
|
-
const width =
|
|
6453
|
+
const width = trace._getExplicitTraceThickness() ?? trace.getSubcircuit()._parsedProps.minTraceWidth ?? 0.16;
|
|
6454
6454
|
const anchorPos = anchorPort._getGlobalPcbPositionAfterLayout();
|
|
6455
6455
|
const otherPos = otherPort._getGlobalPcbPositionAfterLayout();
|
|
6456
6456
|
const route = [];
|
|
@@ -6694,6 +6694,12 @@ var Trace3 = class extends PrimitiveComponent2 {
|
|
|
6694
6694
|
super(props);
|
|
6695
6695
|
this._portsRoutedOnPcb = [];
|
|
6696
6696
|
}
|
|
6697
|
+
/**
|
|
6698
|
+
* Get the explicit trace thickness, supporting 'width' as an alias for 'thickness'
|
|
6699
|
+
*/
|
|
6700
|
+
_getExplicitTraceThickness() {
|
|
6701
|
+
return this._parsedProps.thickness ?? this._parsedProps.width;
|
|
6702
|
+
}
|
|
6697
6703
|
get config() {
|
|
6698
6704
|
return {
|
|
6699
6705
|
zodProps: traceProps,
|
|
@@ -6851,7 +6857,7 @@ var Trace3 = class extends PrimitiveComponent2 {
|
|
|
6851
6857
|
{ db }
|
|
6852
6858
|
) ?? props.maxLength,
|
|
6853
6859
|
display_name: displayName,
|
|
6854
|
-
min_trace_thickness:
|
|
6860
|
+
min_trace_thickness: this._getExplicitTraceThickness()
|
|
6855
6861
|
});
|
|
6856
6862
|
this.source_trace_id = trace.source_trace_id;
|
|
6857
6863
|
}
|
|
@@ -9199,6 +9205,7 @@ var getSimpleRouteJsonFromCircuitJson = ({
|
|
|
9199
9205
|
return {
|
|
9200
9206
|
name: trace.source_trace_id ?? connMap.getNetConnectedToId(trace.source_trace_id) ?? "",
|
|
9201
9207
|
source_trace_id: trace.source_trace_id,
|
|
9208
|
+
width: trace.min_trace_thickness,
|
|
9202
9209
|
pointsToConnect: [
|
|
9203
9210
|
{
|
|
9204
9211
|
x: portA.x,
|
|
@@ -17260,7 +17267,7 @@ import { identity as identity6 } from "transformation-matrix";
|
|
|
17260
17267
|
var package_default = {
|
|
17261
17268
|
name: "@tscircuit/core",
|
|
17262
17269
|
type: "module",
|
|
17263
|
-
version: "0.0.
|
|
17270
|
+
version: "0.0.817",
|
|
17264
17271
|
types: "dist/index.d.ts",
|
|
17265
17272
|
main: "dist/index.js",
|
|
17266
17273
|
module: "dist/index.js",
|
|
@@ -17301,7 +17308,7 @@ var package_default = {
|
|
|
17301
17308
|
"@tscircuit/matchpack": "^0.0.16",
|
|
17302
17309
|
"@tscircuit/math-utils": "^0.0.29",
|
|
17303
17310
|
"@tscircuit/miniflex": "^0.0.4",
|
|
17304
|
-
"@tscircuit/props": "0.0.
|
|
17311
|
+
"@tscircuit/props": "0.0.378",
|
|
17305
17312
|
"@tscircuit/schematic-autolayout": "^0.0.6",
|
|
17306
17313
|
"@tscircuit/schematic-match-adapt": "^0.0.16",
|
|
17307
17314
|
"@tscircuit/schematic-trace-solver": "^0.0.41",
|
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.818",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"module": "dist/index.js",
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
"@tscircuit/matchpack": "^0.0.16",
|
|
43
43
|
"@tscircuit/math-utils": "^0.0.29",
|
|
44
44
|
"@tscircuit/miniflex": "^0.0.4",
|
|
45
|
-
"@tscircuit/props": "0.0.
|
|
45
|
+
"@tscircuit/props": "0.0.378",
|
|
46
46
|
"@tscircuit/schematic-autolayout": "^0.0.6",
|
|
47
47
|
"@tscircuit/schematic-match-adapt": "^0.0.16",
|
|
48
48
|
"@tscircuit/schematic-trace-solver": "^0.0.41",
|