@tscircuit/core 0.0.946 → 0.0.948
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 +50 -1
- package/dist/index.js +186 -5
- package/package.json +3 -3
package/dist/index.d.ts
CHANGED
|
@@ -180,6 +180,7 @@ interface SimpleRouteConnection {
|
|
|
180
180
|
interface SimpleRouteJson {
|
|
181
181
|
layerCount: number;
|
|
182
182
|
minTraceWidth: number;
|
|
183
|
+
nominalTraceWidth?: number;
|
|
183
184
|
obstacles: Obstacle[];
|
|
184
185
|
connections: Array<SimpleRouteConnection>;
|
|
185
186
|
bounds: {
|
|
@@ -2161,6 +2162,7 @@ declare class Board extends Group<typeof boardProps> implements BoardI, Subcircu
|
|
|
2161
2162
|
bomDisabled: zod.ZodOptional<zod.ZodBoolean>;
|
|
2162
2163
|
defaultTraceWidth: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>>;
|
|
2163
2164
|
minTraceWidth: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>>;
|
|
2165
|
+
nominalTraceWidth: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>>;
|
|
2164
2166
|
partsEngine: zod.ZodOptional<zod.ZodType<_tscircuit_props.PartsEngine, zod.ZodTypeDef, _tscircuit_props.PartsEngine>>;
|
|
2165
2167
|
pcbRouteCache: zod.ZodOptional<zod.ZodType<_tscircuit_props.PcbRouteCache, zod.ZodTypeDef, _tscircuit_props.PcbRouteCache>>;
|
|
2166
2168
|
autorouter: zod.ZodOptional<zod.ZodType<_tscircuit_props.AutorouterProp, zod.ZodTypeDef, _tscircuit_props.AutorouterProp>>;
|
|
@@ -2336,6 +2338,7 @@ declare class Board extends Group<typeof boardProps> implements BoardI, Subcircu
|
|
|
2336
2338
|
pcbWidth?: number | undefined;
|
|
2337
2339
|
pcbHeight?: number | undefined;
|
|
2338
2340
|
minTraceWidth?: number | undefined;
|
|
2341
|
+
nominalTraceWidth?: number | undefined;
|
|
2339
2342
|
schWidth?: number | undefined;
|
|
2340
2343
|
schHeight?: number | undefined;
|
|
2341
2344
|
pcbLayout?: {
|
|
@@ -2655,6 +2658,7 @@ declare class Board extends Group<typeof boardProps> implements BoardI, Subcircu
|
|
|
2655
2658
|
pcbWidth?: string | number | undefined;
|
|
2656
2659
|
pcbHeight?: string | number | undefined;
|
|
2657
2660
|
minTraceWidth?: string | number | undefined;
|
|
2661
|
+
nominalTraceWidth?: string | number | undefined;
|
|
2658
2662
|
schWidth?: string | number | undefined;
|
|
2659
2663
|
schHeight?: string | number | undefined;
|
|
2660
2664
|
pcbLayout?: {
|
|
@@ -3016,6 +3020,7 @@ declare class Panel extends Group<typeof panelProps> {
|
|
|
3016
3020
|
pcbWidth: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>>;
|
|
3017
3021
|
pcbHeight: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>>;
|
|
3018
3022
|
minTraceWidth: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>>;
|
|
3023
|
+
nominalTraceWidth: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>>;
|
|
3019
3024
|
schWidth: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>>;
|
|
3020
3025
|
schHeight: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>>;
|
|
3021
3026
|
pcbLayout: zod.ZodOptional<zod.ZodObject<{
|
|
@@ -3567,6 +3572,7 @@ declare class Panel extends Group<typeof panelProps> {
|
|
|
3567
3572
|
pcbWidth?: number | undefined;
|
|
3568
3573
|
pcbHeight?: number | undefined;
|
|
3569
3574
|
minTraceWidth?: number | undefined;
|
|
3575
|
+
nominalTraceWidth?: number | undefined;
|
|
3570
3576
|
schWidth?: number | undefined;
|
|
3571
3577
|
schHeight?: number | undefined;
|
|
3572
3578
|
pcbLayout?: {
|
|
@@ -3839,6 +3845,7 @@ declare class Panel extends Group<typeof panelProps> {
|
|
|
3839
3845
|
pcbWidth?: string | number | undefined;
|
|
3840
3846
|
pcbHeight?: string | number | undefined;
|
|
3841
3847
|
minTraceWidth?: string | number | undefined;
|
|
3848
|
+
nominalTraceWidth?: string | number | undefined;
|
|
3842
3849
|
schWidth?: string | number | undefined;
|
|
3843
3850
|
schHeight?: string | number | undefined;
|
|
3844
3851
|
pcbLayout?: {
|
|
@@ -22703,6 +22710,10 @@ declare class PcbNotePath extends PrimitiveComponent<typeof pcbNotePathProps> {
|
|
|
22703
22710
|
width: number;
|
|
22704
22711
|
height: number;
|
|
22705
22712
|
};
|
|
22713
|
+
_moveCircuitJsonElements({ deltaX, deltaY, }: {
|
|
22714
|
+
deltaX: number;
|
|
22715
|
+
deltaY: number;
|
|
22716
|
+
}): void;
|
|
22706
22717
|
}
|
|
22707
22718
|
|
|
22708
22719
|
declare class PcbNoteDimension extends PrimitiveComponent<typeof pcbNoteDimensionProps> {
|
|
@@ -22895,6 +22906,10 @@ declare class PcbNoteDimension extends PrimitiveComponent<typeof pcbNoteDimensio
|
|
|
22895
22906
|
height: number;
|
|
22896
22907
|
};
|
|
22897
22908
|
private _formatDistanceText;
|
|
22909
|
+
_moveCircuitJsonElements({ deltaX, deltaY, }: {
|
|
22910
|
+
deltaX: number;
|
|
22911
|
+
deltaY: number;
|
|
22912
|
+
}): void;
|
|
22898
22913
|
}
|
|
22899
22914
|
|
|
22900
22915
|
declare class Footprint extends PrimitiveComponent<typeof footprintProps> {
|
|
@@ -23110,6 +23125,10 @@ declare class BreakoutPoint extends PrimitiveComponent<typeof breakoutPointProps
|
|
|
23110
23125
|
x: number;
|
|
23111
23126
|
y: number;
|
|
23112
23127
|
}): void;
|
|
23128
|
+
_moveCircuitJsonElements({ deltaX, deltaY, }: {
|
|
23129
|
+
deltaX: number;
|
|
23130
|
+
deltaY: number;
|
|
23131
|
+
}): void;
|
|
23113
23132
|
getPcbSize(): {
|
|
23114
23133
|
width: number;
|
|
23115
23134
|
height: number;
|
|
@@ -23660,6 +23679,10 @@ declare class Hole extends PrimitiveComponent<typeof holeProps> {
|
|
|
23660
23679
|
x: number;
|
|
23661
23680
|
y: number;
|
|
23662
23681
|
}): void;
|
|
23682
|
+
_moveCircuitJsonElements({ deltaX, deltaY, }: {
|
|
23683
|
+
deltaX: number;
|
|
23684
|
+
deltaY: number;
|
|
23685
|
+
}): void;
|
|
23663
23686
|
}
|
|
23664
23687
|
|
|
23665
23688
|
declare class Keepout extends PrimitiveComponent<typeof pcbKeepoutProps> {
|
|
@@ -25660,6 +25683,10 @@ declare class PlatedHole extends PrimitiveComponent<typeof platedHoleProps> {
|
|
|
25660
25683
|
doInitialPortMatching(): void;
|
|
25661
25684
|
doInitialPcbPrimitiveRender(): void;
|
|
25662
25685
|
doInitialPcbPortAttachment(): void;
|
|
25686
|
+
_moveCircuitJsonElements({ deltaX, deltaY, }: {
|
|
25687
|
+
deltaX: number;
|
|
25688
|
+
deltaY: number;
|
|
25689
|
+
}): void;
|
|
25663
25690
|
}
|
|
25664
25691
|
|
|
25665
25692
|
declare class SilkscreenCircle extends PrimitiveComponent<typeof silkscreenCircleProps> {
|
|
@@ -27297,6 +27324,10 @@ declare class SmtPad extends PrimitiveComponent<typeof smtPadProps> {
|
|
|
27297
27324
|
x: number;
|
|
27298
27325
|
y: number;
|
|
27299
27326
|
}): void;
|
|
27327
|
+
_moveCircuitJsonElements({ deltaX, deltaY, }: {
|
|
27328
|
+
deltaX: number;
|
|
27329
|
+
deltaY: number;
|
|
27330
|
+
}): void;
|
|
27300
27331
|
}
|
|
27301
27332
|
|
|
27302
27333
|
declare class Fiducial extends PrimitiveComponent<typeof fiducialProps> {
|
|
@@ -28436,6 +28467,10 @@ declare class Fiducial extends PrimitiveComponent<typeof fiducialProps> {
|
|
|
28436
28467
|
x: number;
|
|
28437
28468
|
y: number;
|
|
28438
28469
|
}): void;
|
|
28470
|
+
_moveCircuitJsonElements({ deltaX, deltaY, }: {
|
|
28471
|
+
deltaX: number;
|
|
28472
|
+
deltaY: number;
|
|
28473
|
+
}): void;
|
|
28439
28474
|
}
|
|
28440
28475
|
|
|
28441
28476
|
declare const pcbTraceProps: z.ZodObject<{
|
|
@@ -29167,6 +29202,7 @@ declare class CopperPour extends PrimitiveComponent<typeof copperPourProps> {
|
|
|
29167
29202
|
|
|
29168
29203
|
declare class CopperText extends PrimitiveComponent<typeof copperTextProps> {
|
|
29169
29204
|
isPcbPrimitive: boolean;
|
|
29205
|
+
pcb_copper_text_id: string | null;
|
|
29170
29206
|
get config(): {
|
|
29171
29207
|
componentName: string;
|
|
29172
29208
|
zodProps: zod.ZodObject<{
|
|
@@ -29331,6 +29367,14 @@ declare class CopperText extends PrimitiveComponent<typeof copperTextProps> {
|
|
|
29331
29367
|
}>;
|
|
29332
29368
|
};
|
|
29333
29369
|
doInitialPcbPrimitiveRender(): void;
|
|
29370
|
+
getPcbSize(): {
|
|
29371
|
+
width: number;
|
|
29372
|
+
height: number;
|
|
29373
|
+
};
|
|
29374
|
+
_moveCircuitJsonElements({ deltaX, deltaY, }: {
|
|
29375
|
+
deltaX: number;
|
|
29376
|
+
deltaY: number;
|
|
29377
|
+
}): void;
|
|
29334
29378
|
}
|
|
29335
29379
|
|
|
29336
29380
|
declare class Cutout extends PrimitiveComponent<typeof cutoutProps> {
|
|
@@ -29774,6 +29818,10 @@ declare class Cutout extends PrimitiveComponent<typeof cutoutProps> {
|
|
|
29774
29818
|
x: number;
|
|
29775
29819
|
y: number;
|
|
29776
29820
|
}): void;
|
|
29821
|
+
_moveCircuitJsonElements({ deltaX, deltaY, }: {
|
|
29822
|
+
deltaX: number;
|
|
29823
|
+
deltaY: number;
|
|
29824
|
+
}): void;
|
|
29777
29825
|
}
|
|
29778
29826
|
|
|
29779
29827
|
declare class Battery extends NormalComponent<typeof batteryProps, PassivePorts> {
|
|
@@ -45665,11 +45713,12 @@ declare const applyEditEvents: ({ circuitJson, editEvents, }: {
|
|
|
45665
45713
|
/**
|
|
45666
45714
|
* This function can only be called in the PcbTraceRender phase or later
|
|
45667
45715
|
*/
|
|
45668
|
-
declare const getSimpleRouteJsonFromCircuitJson: ({ db, circuitJson, subcircuit_id, minTraceWidth, }: {
|
|
45716
|
+
declare const getSimpleRouteJsonFromCircuitJson: ({ db, circuitJson, subcircuit_id, minTraceWidth, nominalTraceWidth, }: {
|
|
45669
45717
|
db?: CircuitJsonUtilObjects;
|
|
45670
45718
|
circuitJson?: AnyCircuitElement[];
|
|
45671
45719
|
subcircuit_id?: string | null;
|
|
45672
45720
|
minTraceWidth?: number;
|
|
45721
|
+
nominalTraceWidth?: number;
|
|
45673
45722
|
}) => {
|
|
45674
45723
|
simpleRouteJson: SimpleRouteJson;
|
|
45675
45724
|
connMap: ConnectivityMap;
|
package/dist/index.js
CHANGED
|
@@ -2491,6 +2491,30 @@ var SmtPad = class extends PrimitiveComponent2 {
|
|
|
2491
2491
|
}
|
|
2492
2492
|
this.matchedPort?._setPositionFromLayout(newCenter);
|
|
2493
2493
|
}
|
|
2494
|
+
_moveCircuitJsonElements({
|
|
2495
|
+
deltaX,
|
|
2496
|
+
deltaY
|
|
2497
|
+
}) {
|
|
2498
|
+
if (this.root?.pcbDisabled) return;
|
|
2499
|
+
const { db } = this.root;
|
|
2500
|
+
if (!this.pcb_smtpad_id) return;
|
|
2501
|
+
const pad = db.pcb_smtpad.get(this.pcb_smtpad_id);
|
|
2502
|
+
if (pad.shape === "rect" || pad.shape === "circle" || pad.shape === "rotated_rect" || pad.shape === "pill") {
|
|
2503
|
+
this._setPositionFromLayout({ x: pad.x + deltaX, y: pad.y + deltaY });
|
|
2504
|
+
} else if (pad.shape === "polygon") {
|
|
2505
|
+
db.pcb_smtpad.update(this.pcb_smtpad_id, {
|
|
2506
|
+
points: pad.points.map((p) => ({
|
|
2507
|
+
x: p.x + deltaX,
|
|
2508
|
+
y: p.y + deltaY
|
|
2509
|
+
}))
|
|
2510
|
+
});
|
|
2511
|
+
const newCenter = {
|
|
2512
|
+
x: this._getPcbCircuitJsonBounds().center.x + deltaX / 2,
|
|
2513
|
+
y: this._getPcbCircuitJsonBounds().center.y + deltaY / 2
|
|
2514
|
+
};
|
|
2515
|
+
this.matchedPort?._setPositionFromLayout(newCenter);
|
|
2516
|
+
}
|
|
2517
|
+
}
|
|
2494
2518
|
};
|
|
2495
2519
|
|
|
2496
2520
|
// lib/components/primitive-components/SilkscreenPath.ts
|
|
@@ -2967,6 +2991,22 @@ var PlatedHole = class extends PrimitiveComponent2 {
|
|
|
2967
2991
|
pcb_port_id: this.matchedPort?.pcb_port_id
|
|
2968
2992
|
});
|
|
2969
2993
|
}
|
|
2994
|
+
_moveCircuitJsonElements({
|
|
2995
|
+
deltaX,
|
|
2996
|
+
deltaY
|
|
2997
|
+
}) {
|
|
2998
|
+
if (this.root?.pcbDisabled) return;
|
|
2999
|
+
const { db } = this.root;
|
|
3000
|
+
if (!this.pcb_plated_hole_id) return;
|
|
3001
|
+
const hole = db.pcb_plated_hole.get(this.pcb_plated_hole_id);
|
|
3002
|
+
if (hole) {
|
|
3003
|
+
const newCenter = {
|
|
3004
|
+
x: hole.x + deltaX,
|
|
3005
|
+
y: hole.y + deltaY
|
|
3006
|
+
};
|
|
3007
|
+
this._setPositionFromLayout(newCenter);
|
|
3008
|
+
}
|
|
3009
|
+
}
|
|
2970
3010
|
};
|
|
2971
3011
|
|
|
2972
3012
|
// lib/components/primitive-components/Keepout.ts
|
|
@@ -3154,6 +3194,21 @@ var Hole = class extends PrimitiveComponent2 {
|
|
|
3154
3194
|
y: newCenter.y
|
|
3155
3195
|
});
|
|
3156
3196
|
}
|
|
3197
|
+
_moveCircuitJsonElements({
|
|
3198
|
+
deltaX,
|
|
3199
|
+
deltaY
|
|
3200
|
+
}) {
|
|
3201
|
+
if (this.root?.pcbDisabled) return;
|
|
3202
|
+
const { db } = this.root;
|
|
3203
|
+
if (!this.pcb_hole_id) return;
|
|
3204
|
+
const hole = db.pcb_hole.get(this.pcb_hole_id);
|
|
3205
|
+
if (hole) {
|
|
3206
|
+
db.pcb_hole.update(this.pcb_hole_id, {
|
|
3207
|
+
x: hole.x + deltaX,
|
|
3208
|
+
y: hole.y + deltaY
|
|
3209
|
+
});
|
|
3210
|
+
}
|
|
3211
|
+
}
|
|
3157
3212
|
};
|
|
3158
3213
|
|
|
3159
3214
|
// lib/components/primitive-components/SilkscreenText.ts
|
|
@@ -3400,6 +3455,27 @@ var Cutout = class extends PrimitiveComponent2 {
|
|
|
3400
3455
|
});
|
|
3401
3456
|
}
|
|
3402
3457
|
}
|
|
3458
|
+
_moveCircuitJsonElements({
|
|
3459
|
+
deltaX,
|
|
3460
|
+
deltaY
|
|
3461
|
+
}) {
|
|
3462
|
+
if (!this.pcb_cutout_id) return;
|
|
3463
|
+
const { db } = this.root;
|
|
3464
|
+
const cutout = db.pcb_cutout.get(this.pcb_cutout_id);
|
|
3465
|
+
if (!cutout) return;
|
|
3466
|
+
if (cutout.shape === "rect" || cutout.shape === "circle") {
|
|
3467
|
+
db.pcb_cutout.update(this.pcb_cutout_id, {
|
|
3468
|
+
center: { x: cutout.center.x + deltaX, y: cutout.center.y + deltaY }
|
|
3469
|
+
});
|
|
3470
|
+
} else if (cutout.shape === "polygon") {
|
|
3471
|
+
db.pcb_cutout.update(this.pcb_cutout_id, {
|
|
3472
|
+
points: cutout.points.map((p) => ({
|
|
3473
|
+
x: p.x + deltaX,
|
|
3474
|
+
y: p.y + deltaY
|
|
3475
|
+
}))
|
|
3476
|
+
});
|
|
3477
|
+
}
|
|
3478
|
+
}
|
|
3403
3479
|
};
|
|
3404
3480
|
|
|
3405
3481
|
// lib/utils/createPinrowSilkscreenText.ts
|
|
@@ -10095,7 +10171,8 @@ var getSimpleRouteJsonFromCircuitJson = ({
|
|
|
10095
10171
|
db,
|
|
10096
10172
|
circuitJson,
|
|
10097
10173
|
subcircuit_id,
|
|
10098
|
-
minTraceWidth = 0.1
|
|
10174
|
+
minTraceWidth = 0.1,
|
|
10175
|
+
nominalTraceWidth
|
|
10099
10176
|
}) => {
|
|
10100
10177
|
if (!db && circuitJson) {
|
|
10101
10178
|
db = su4(circuitJson);
|
|
@@ -10426,6 +10503,7 @@ var getSimpleRouteJsonFromCircuitJson = ({
|
|
|
10426
10503
|
// subcircuit
|
|
10427
10504
|
layerCount: board?.num_layers ?? 2,
|
|
10428
10505
|
minTraceWidth,
|
|
10506
|
+
nominalTraceWidth,
|
|
10429
10507
|
outline: board?.outline?.map((point2) => ({ ...point2 }))
|
|
10430
10508
|
},
|
|
10431
10509
|
connMap
|
|
@@ -14121,6 +14199,7 @@ var Group6 = class extends NormalComponent3 {
|
|
|
14121
14199
|
input_simple_route_json: getSimpleRouteJsonFromCircuitJson({
|
|
14122
14200
|
db,
|
|
14123
14201
|
minTraceWidth: this.props.autorouter?.minTraceWidth ?? 0.15,
|
|
14202
|
+
nominalTraceWidth: this.props.nominalTraceWidth,
|
|
14124
14203
|
subcircuit_id: this.subcircuit_id
|
|
14125
14204
|
}).simpleRouteJson,
|
|
14126
14205
|
subcircuit_id: this.subcircuit_id
|
|
@@ -14224,6 +14303,7 @@ var Group6 = class extends NormalComponent3 {
|
|
|
14224
14303
|
const { simpleRouteJson } = getSimpleRouteJsonFromCircuitJson({
|
|
14225
14304
|
db,
|
|
14226
14305
|
minTraceWidth: this.props.autorouter?.minTraceWidth ?? 0.15,
|
|
14306
|
+
nominalTraceWidth: this.props.nominalTraceWidth,
|
|
14227
14307
|
subcircuit_id: this.subcircuit_id
|
|
14228
14308
|
});
|
|
14229
14309
|
if (debug11.enabled) {
|
|
@@ -17813,6 +17893,24 @@ var PcbNotePath = class extends PrimitiveComponent2 {
|
|
|
17813
17893
|
const maxY = Math.max(...ys);
|
|
17814
17894
|
return { width: maxX - minX, height: maxY - minY };
|
|
17815
17895
|
}
|
|
17896
|
+
_moveCircuitJsonElements({
|
|
17897
|
+
deltaX,
|
|
17898
|
+
deltaY
|
|
17899
|
+
}) {
|
|
17900
|
+
if (this.root?.pcbDisabled) return;
|
|
17901
|
+
const { db } = this.root;
|
|
17902
|
+
if (!this.pcb_note_path_id) return;
|
|
17903
|
+
const path = db.pcb_note_path.get(this.pcb_note_path_id);
|
|
17904
|
+
if (path) {
|
|
17905
|
+
db.pcb_note_path.update(this.pcb_note_path_id, {
|
|
17906
|
+
route: path.route.map((p) => ({
|
|
17907
|
+
...p,
|
|
17908
|
+
x: p.x + deltaX,
|
|
17909
|
+
y: p.y + deltaY
|
|
17910
|
+
}))
|
|
17911
|
+
});
|
|
17912
|
+
}
|
|
17913
|
+
}
|
|
17816
17914
|
};
|
|
17817
17915
|
|
|
17818
17916
|
// lib/components/primitive-components/PcbNoteDimension.ts
|
|
@@ -17894,6 +17992,27 @@ var PcbNoteDimension = class extends PrimitiveComponent2 {
|
|
|
17894
17992
|
const valueText = units === "in" ? Number(distanceInUnits.toFixed(decimalPlaces)).toString() : distanceInUnits.toFixed(decimalPlaces);
|
|
17895
17993
|
return `${valueText}${units}`;
|
|
17896
17994
|
}
|
|
17995
|
+
_moveCircuitJsonElements({
|
|
17996
|
+
deltaX,
|
|
17997
|
+
deltaY
|
|
17998
|
+
}) {
|
|
17999
|
+
if (this.root?.pcbDisabled) return;
|
|
18000
|
+
const { db } = this.root;
|
|
18001
|
+
if (!this.pcb_note_dimension_id) return;
|
|
18002
|
+
const dimension = db.pcb_note_dimension.get(this.pcb_note_dimension_id);
|
|
18003
|
+
if (dimension) {
|
|
18004
|
+
db.pcb_note_dimension.update(this.pcb_note_dimension_id, {
|
|
18005
|
+
from: {
|
|
18006
|
+
x: dimension.from.x + deltaX,
|
|
18007
|
+
y: dimension.from.y + deltaY
|
|
18008
|
+
},
|
|
18009
|
+
to: {
|
|
18010
|
+
x: dimension.to.x + deltaX,
|
|
18011
|
+
y: dimension.to.y + deltaY
|
|
18012
|
+
}
|
|
18013
|
+
});
|
|
18014
|
+
}
|
|
18015
|
+
}
|
|
17897
18016
|
};
|
|
17898
18017
|
|
|
17899
18018
|
// lib/components/primitive-components/Group/Subcircuit/Subcircuit.ts
|
|
@@ -18030,6 +18149,21 @@ var BreakoutPoint = class extends PrimitiveComponent2 {
|
|
|
18030
18149
|
y: newCenter.y
|
|
18031
18150
|
});
|
|
18032
18151
|
}
|
|
18152
|
+
_moveCircuitJsonElements({
|
|
18153
|
+
deltaX,
|
|
18154
|
+
deltaY
|
|
18155
|
+
}) {
|
|
18156
|
+
if (this.root?.pcbDisabled) return;
|
|
18157
|
+
const { db } = this.root;
|
|
18158
|
+
if (!this.pcb_breakout_point_id) return;
|
|
18159
|
+
const point2 = db.pcb_breakout_point.get(this.pcb_breakout_point_id);
|
|
18160
|
+
if (point2) {
|
|
18161
|
+
db.pcb_breakout_point.update(this.pcb_breakout_point_id, {
|
|
18162
|
+
x: point2.x + deltaX,
|
|
18163
|
+
y: point2.y + deltaY
|
|
18164
|
+
});
|
|
18165
|
+
}
|
|
18166
|
+
}
|
|
18033
18167
|
getPcbSize() {
|
|
18034
18168
|
return { width: 0, height: 0 };
|
|
18035
18169
|
}
|
|
@@ -18491,6 +18625,26 @@ var Fiducial = class extends PrimitiveComponent2 {
|
|
|
18491
18625
|
y: newCenter.y
|
|
18492
18626
|
});
|
|
18493
18627
|
}
|
|
18628
|
+
_moveCircuitJsonElements({
|
|
18629
|
+
deltaX,
|
|
18630
|
+
deltaY
|
|
18631
|
+
}) {
|
|
18632
|
+
if (this.root?.pcbDisabled) return;
|
|
18633
|
+
const { db } = this.root;
|
|
18634
|
+
if (!this.pcb_smtpad_id) return;
|
|
18635
|
+
const pad = db.pcb_smtpad.get(this.pcb_smtpad_id);
|
|
18636
|
+
if (!pad) return;
|
|
18637
|
+
if (pad.shape === "rect" || pad.shape === "circle" || pad.shape === "rotated_rect" || pad.shape === "pill") {
|
|
18638
|
+
this._setPositionFromLayout({ x: pad.x + deltaX, y: pad.y + deltaY });
|
|
18639
|
+
} else if (pad.shape === "polygon") {
|
|
18640
|
+
db.pcb_smtpad.update(this.pcb_smtpad_id, {
|
|
18641
|
+
points: pad.points.map((p) => ({
|
|
18642
|
+
x: p.x + deltaX,
|
|
18643
|
+
y: p.y + deltaY
|
|
18644
|
+
}))
|
|
18645
|
+
});
|
|
18646
|
+
}
|
|
18647
|
+
}
|
|
18494
18648
|
};
|
|
18495
18649
|
|
|
18496
18650
|
// lib/components/primitive-components/Via.ts
|
|
@@ -18713,6 +18867,7 @@ var CopperPour = class extends PrimitiveComponent2 {
|
|
|
18713
18867
|
import { copperTextProps } from "@tscircuit/props";
|
|
18714
18868
|
var CopperText = class extends PrimitiveComponent2 {
|
|
18715
18869
|
isPcbPrimitive = true;
|
|
18870
|
+
pcb_copper_text_id = null;
|
|
18716
18871
|
get config() {
|
|
18717
18872
|
return {
|
|
18718
18873
|
componentName: "CopperText",
|
|
@@ -18726,7 +18881,7 @@ var CopperText = class extends PrimitiveComponent2 {
|
|
|
18726
18881
|
const container = this.getPrimitiveContainer();
|
|
18727
18882
|
const position = this._getGlobalPcbPositionBeforeLayout();
|
|
18728
18883
|
const subcircuit = this.getSubcircuit();
|
|
18729
|
-
db.pcb_copper_text.insert({
|
|
18884
|
+
const pcb_copper_text = db.pcb_copper_text.insert({
|
|
18730
18885
|
anchor_alignment: props.anchorAlignment,
|
|
18731
18886
|
anchor_position: {
|
|
18732
18887
|
x: position.x,
|
|
@@ -18743,6 +18898,32 @@ var CopperText = class extends PrimitiveComponent2 {
|
|
|
18743
18898
|
subcircuit_id: subcircuit?.subcircuit_id ?? void 0,
|
|
18744
18899
|
pcb_group_id: this.getGroup()?.pcb_group_id ?? void 0
|
|
18745
18900
|
});
|
|
18901
|
+
this.pcb_copper_text_id = pcb_copper_text.pcb_copper_text_id;
|
|
18902
|
+
}
|
|
18903
|
+
getPcbSize() {
|
|
18904
|
+
const { _parsedProps: props } = this;
|
|
18905
|
+
const fontSize = props.fontSize ?? 1;
|
|
18906
|
+
const text = props.text ?? "";
|
|
18907
|
+
const textWidth = text.length * fontSize;
|
|
18908
|
+
const textHeight = fontSize;
|
|
18909
|
+
return { width: textWidth * fontSize, height: textHeight * fontSize };
|
|
18910
|
+
}
|
|
18911
|
+
_moveCircuitJsonElements({
|
|
18912
|
+
deltaX,
|
|
18913
|
+
deltaY
|
|
18914
|
+
}) {
|
|
18915
|
+
if (this.root?.pcbDisabled) return;
|
|
18916
|
+
const { db } = this.root;
|
|
18917
|
+
if (!this.pcb_copper_text_id) return;
|
|
18918
|
+
const text = db.pcb_copper_text.get(this.pcb_copper_text_id);
|
|
18919
|
+
if (text) {
|
|
18920
|
+
db.pcb_copper_text.update(this.pcb_copper_text_id, {
|
|
18921
|
+
anchor_position: {
|
|
18922
|
+
x: text.anchor_position.x + deltaX,
|
|
18923
|
+
y: text.anchor_position.y + deltaY
|
|
18924
|
+
}
|
|
18925
|
+
});
|
|
18926
|
+
}
|
|
18746
18927
|
}
|
|
18747
18928
|
};
|
|
18748
18929
|
|
|
@@ -20123,7 +20304,7 @@ import { identity as identity5 } from "transformation-matrix";
|
|
|
20123
20304
|
var package_default = {
|
|
20124
20305
|
name: "@tscircuit/core",
|
|
20125
20306
|
type: "module",
|
|
20126
|
-
version: "0.0.
|
|
20307
|
+
version: "0.0.947",
|
|
20127
20308
|
types: "dist/index.d.ts",
|
|
20128
20309
|
main: "dist/index.js",
|
|
20129
20310
|
module: "dist/index.js",
|
|
@@ -20154,7 +20335,7 @@ var package_default = {
|
|
|
20154
20335
|
devDependencies: {
|
|
20155
20336
|
"@biomejs/biome": "^1.8.3",
|
|
20156
20337
|
"@resvg/resvg-js": "^2.6.2",
|
|
20157
|
-
"@tscircuit/capacity-autorouter": "^0.0.
|
|
20338
|
+
"@tscircuit/capacity-autorouter": "^0.0.206",
|
|
20158
20339
|
"@tscircuit/checks": "^0.0.87",
|
|
20159
20340
|
"@tscircuit/circuit-json-util": "^0.0.73",
|
|
20160
20341
|
"@tscircuit/common": "^0.0.20",
|
|
@@ -20166,7 +20347,7 @@ var package_default = {
|
|
|
20166
20347
|
"@tscircuit/math-utils": "^0.0.29",
|
|
20167
20348
|
"@tscircuit/miniflex": "^0.0.4",
|
|
20168
20349
|
"@tscircuit/ngspice-spice-engine": "^0.0.8",
|
|
20169
|
-
"@tscircuit/props": "^0.0.
|
|
20350
|
+
"@tscircuit/props": "^0.0.440",
|
|
20170
20351
|
"@tscircuit/schematic-match-adapt": "^0.0.16",
|
|
20171
20352
|
"@tscircuit/schematic-trace-solver": "^v0.0.45",
|
|
20172
20353
|
"@tscircuit/solver-utils": "^0.0.3",
|
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.948",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"module": "dist/index.js",
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"devDependencies": {
|
|
33
33
|
"@biomejs/biome": "^1.8.3",
|
|
34
34
|
"@resvg/resvg-js": "^2.6.2",
|
|
35
|
-
"@tscircuit/capacity-autorouter": "^0.0.
|
|
35
|
+
"@tscircuit/capacity-autorouter": "^0.0.206",
|
|
36
36
|
"@tscircuit/checks": "^0.0.87",
|
|
37
37
|
"@tscircuit/circuit-json-util": "^0.0.73",
|
|
38
38
|
"@tscircuit/common": "^0.0.20",
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
"@tscircuit/math-utils": "^0.0.29",
|
|
45
45
|
"@tscircuit/miniflex": "^0.0.4",
|
|
46
46
|
"@tscircuit/ngspice-spice-engine": "^0.0.8",
|
|
47
|
-
"@tscircuit/props": "^0.0.
|
|
47
|
+
"@tscircuit/props": "^0.0.440",
|
|
48
48
|
"@tscircuit/schematic-match-adapt": "^0.0.16",
|
|
49
49
|
"@tscircuit/schematic-trace-solver": "^v0.0.45",
|
|
50
50
|
"@tscircuit/solver-utils": "^0.0.3",
|