@tscircuit/core 0.0.920 → 0.0.922
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 +28 -7
- package/dist/index.js +77 -13
- package/package.json +4 -4
package/dist/index.d.ts
CHANGED
|
@@ -12,6 +12,8 @@ import { Matrix } from 'transformation-matrix';
|
|
|
12
12
|
import { CircuitJsonUtilObjects } from '@tscircuit/circuit-json-util';
|
|
13
13
|
import { ConnectivityMap } from 'circuit-json-to-connectivity-map';
|
|
14
14
|
import { GraphicsObject } from 'graphics-debug';
|
|
15
|
+
import { PackSolver2 } from 'calculate-packing';
|
|
16
|
+
import { AutoroutingPipelineSolver, AssignableViaAutoroutingPipelineSolver } from '@tscircuit/capacity-autorouter';
|
|
15
17
|
|
|
16
18
|
declare const orderedRenderPhases: readonly ["ReactSubtreesRender", "InflateSubcircuitCircuitJson", "SourceNameDuplicateComponentRemoval", "PcbFootprintStringRender", "InitializePortsFromChildren", "CreateNetsFromProps", "AssignFallbackProps", "CreateTracesFromProps", "CreateTracesFromNetLabels", "CreateTraceHintsFromProps", "SourceGroupRender", "AssignNameToUnnamedComponents", "SourceRender", "SourceParentAttachment", "PortMatching", "OptimizeSelectorCache", "SourceTraceRender", "SourceAddConnectivityMapKey", "SourceDesignRuleChecks", "SimulationRender", "SchematicComponentRender", "SchematicPortRender", "SchematicPrimitiveRender", "SchematicComponentSizeCalculation", "SchematicLayout", "SchematicTraceRender", "SchematicReplaceNetLabelsWithSymbols", "PcbComponentRender", "PcbPrimitiveRender", "PcbFootprintLayout", "PcbPortRender", "PcbPortAttachment", "PcbComponentSizeCalculation", "PcbComponentAnchorAlignment", "PcbLayout", "PcbBoardAutoSize", "PanelLayout", "PcbTraceHintRender", "PcbManualTraceRender", "PcbTraceRender", "PcbRouteNetIslands", "PcbCopperPourRender", "PcbDesignRuleChecks", "SilkscreenOverlapAdjustment", "CadModelRender", "PartsEngineRender", "SimulationSpiceEngineRender"];
|
|
17
19
|
type RenderPhase = (typeof orderedRenderPhases)[number];
|
|
@@ -183,7 +185,7 @@ interface SimpleRouteJson {
|
|
|
183
185
|
traces?: SimplifiedPcbTrace[];
|
|
184
186
|
}
|
|
185
187
|
|
|
186
|
-
type RootCircuitEventName = "asyncEffect:start" | "asyncEffect:end" | "renderable:renderLifecycle:anyEvent" | `renderable:renderLifecycle:${RenderPhase}:start` | `renderable:renderLifecycle:${RenderPhase}:end` | `board:renderPhaseStarted` | "external:evalError" | "autorouting:start" | "autorouting:end" | "autorouting:error" | "autorouting:progress" | "packing:start" | "packing:end" | "packing:error" | "renderComplete" | "debug:logOutput";
|
|
188
|
+
type RootCircuitEventName = "asyncEffect:start" | "asyncEffect:end" | "renderable:renderLifecycle:anyEvent" | `renderable:renderLifecycle:${RenderPhase}:start` | `renderable:renderLifecycle:${RenderPhase}:end` | `board:renderPhaseStarted` | "external:evalError" | "autorouting:start" | "autorouting:end" | "autorouting:error" | "autorouting:progress" | "packing:start" | "packing:end" | "packing:error" | "solver:started" | "renderComplete" | "debug:logOutput";
|
|
187
189
|
interface AutoroutingStartEvent {
|
|
188
190
|
type: "autorouting:start";
|
|
189
191
|
subcircuit_id: string;
|
|
@@ -230,6 +232,12 @@ interface PackingErrorEvent {
|
|
|
230
232
|
message: string;
|
|
231
233
|
};
|
|
232
234
|
}
|
|
235
|
+
interface SolverStartedEvent {
|
|
236
|
+
type: "solver:started";
|
|
237
|
+
solverName: string;
|
|
238
|
+
solverParams: unknown;
|
|
239
|
+
componentName: string;
|
|
240
|
+
}
|
|
233
241
|
interface DebugLogOutputEvent {
|
|
234
242
|
type: "debug:logOutput";
|
|
235
243
|
name: string;
|
|
@@ -2135,6 +2143,7 @@ declare class Board extends Group<typeof boardProps> implements BoardI, Subcircu
|
|
|
2135
2143
|
x: string | number;
|
|
2136
2144
|
y: string | number;
|
|
2137
2145
|
}>>;
|
|
2146
|
+
anchorAlignment: zod.ZodOptional<zod.ZodEnum<["top_left", "top_center", "top_right", "center_left", "center", "center_right", "bottom_left", "bottom_center", "bottom_right"]>>;
|
|
2138
2147
|
boardAnchorAlignment: zod.ZodOptional<zod.ZodEnum<["top_left", "top_center", "top_right", "center_left", "center", "center_right", "bottom_left", "bottom_center", "bottom_right"]>>;
|
|
2139
2148
|
title: zod.ZodOptional<zod.ZodString>;
|
|
2140
2149
|
solderMaskColor: zod.ZodOptional<zod.ZodType<_tscircuit_props.BoardColor, zod.ZodTypeDef, _tscircuit_props.BoardColor>>;
|
|
@@ -2453,6 +2462,7 @@ declare class Board extends Group<typeof boardProps> implements BoardI, Subcircu
|
|
|
2453
2462
|
x: number;
|
|
2454
2463
|
y: number;
|
|
2455
2464
|
} | undefined;
|
|
2465
|
+
anchorAlignment?: "top_left" | "top_center" | "top_right" | "center_left" | "center" | "center_right" | "bottom_left" | "bottom_center" | "bottom_right" | undefined;
|
|
2456
2466
|
boardAnchorAlignment?: "top_left" | "top_center" | "top_right" | "center_left" | "center" | "center_right" | "bottom_left" | "bottom_center" | "bottom_right" | undefined;
|
|
2457
2467
|
solderMaskColor?: _tscircuit_props.BoardColor | undefined;
|
|
2458
2468
|
topSolderMaskColor?: _tscircuit_props.BoardColor | undefined;
|
|
@@ -2772,6 +2782,7 @@ declare class Board extends Group<typeof boardProps> implements BoardI, Subcircu
|
|
|
2772
2782
|
x: string | number;
|
|
2773
2783
|
y: string | number;
|
|
2774
2784
|
} | undefined;
|
|
2785
|
+
anchorAlignment?: "top_left" | "top_center" | "top_right" | "center_left" | "center" | "center_right" | "bottom_left" | "bottom_center" | "bottom_right" | undefined;
|
|
2775
2786
|
boardAnchorAlignment?: "top_left" | "top_center" | "top_right" | "center_left" | "center" | "center_right" | "bottom_left" | "bottom_center" | "bottom_right" | undefined;
|
|
2776
2787
|
solderMaskColor?: _tscircuit_props.BoardColor | undefined;
|
|
2777
2788
|
topSolderMaskColor?: _tscircuit_props.BoardColor | undefined;
|
|
@@ -3351,6 +3362,7 @@ declare class Panel extends Group<typeof panelProps> {
|
|
|
3351
3362
|
width: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>>;
|
|
3352
3363
|
height: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>>;
|
|
3353
3364
|
children: zod.ZodOptional<zod.ZodAny>;
|
|
3365
|
+
anchorAlignment: zod.ZodOptional<zod.ZodEnum<["top_left", "top_center", "top_right", "center_left", "center", "center_right", "bottom_left", "bottom_center", "bottom_right"]>>;
|
|
3354
3366
|
noSolderMask: zod.ZodOptional<zod.ZodBoolean>;
|
|
3355
3367
|
panelizationMethod: zod.ZodOptional<zod.ZodEnum<["tab-routing", "none"]>>;
|
|
3356
3368
|
boardGap: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>>;
|
|
@@ -3621,6 +3633,7 @@ declare class Panel extends Group<typeof panelProps> {
|
|
|
3621
3633
|
schGap?: string | number | undefined;
|
|
3622
3634
|
schPack?: boolean | undefined;
|
|
3623
3635
|
schMatchAdapt?: boolean | undefined;
|
|
3636
|
+
anchorAlignment?: "top_left" | "top_center" | "top_right" | "center_left" | "center" | "center_right" | "bottom_left" | "bottom_center" | "bottom_right" | undefined;
|
|
3624
3637
|
noSolderMask?: boolean | undefined;
|
|
3625
3638
|
panelizationMethod?: "none" | "tab-routing" | undefined;
|
|
3626
3639
|
boardGap?: number | undefined;
|
|
@@ -3891,6 +3904,7 @@ declare class Panel extends Group<typeof panelProps> {
|
|
|
3891
3904
|
schGap?: string | number | undefined;
|
|
3892
3905
|
schPack?: boolean | undefined;
|
|
3893
3906
|
schMatchAdapt?: boolean | undefined;
|
|
3907
|
+
anchorAlignment?: "top_left" | "top_center" | "top_right" | "center_left" | "center" | "center_right" | "bottom_left" | "bottom_center" | "bottom_right" | undefined;
|
|
3894
3908
|
noSolderMask?: boolean | undefined;
|
|
3895
3909
|
panelizationMethod?: "none" | "tab-routing" | undefined;
|
|
3896
3910
|
boardGap?: string | number | undefined;
|
|
@@ -20530,8 +20544,8 @@ declare class FabricationNoteText extends PrimitiveComponent<typeof fabricationN
|
|
|
20530
20544
|
fontSize: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>>;
|
|
20531
20545
|
color: zod.ZodOptional<zod.ZodString>;
|
|
20532
20546
|
}, "strip", zod.ZodTypeAny, {
|
|
20533
|
-
text: string;
|
|
20534
20547
|
anchorAlignment: "top_left" | "top_right" | "center" | "bottom_left" | "bottom_right";
|
|
20548
|
+
text: string;
|
|
20535
20549
|
pcbX?: string | number | undefined;
|
|
20536
20550
|
pcbY?: string | number | undefined;
|
|
20537
20551
|
pcbLeftEdgeX?: string | number | undefined;
|
|
@@ -20599,8 +20613,8 @@ declare class FabricationNoteText extends PrimitiveComponent<typeof fabricationN
|
|
|
20599
20613
|
} | undefined;
|
|
20600
20614
|
pcbRelative?: boolean | undefined;
|
|
20601
20615
|
relative?: boolean | undefined;
|
|
20602
|
-
color?: string | undefined;
|
|
20603
20616
|
anchorAlignment?: "top_left" | "top_right" | "center" | "bottom_left" | "bottom_right" | undefined;
|
|
20617
|
+
color?: string | undefined;
|
|
20604
20618
|
font?: "tscircuit2024" | undefined;
|
|
20605
20619
|
fontSize?: string | number | undefined;
|
|
20606
20620
|
}>;
|
|
@@ -21184,8 +21198,8 @@ declare class PcbNoteText extends PrimitiveComponent<typeof pcbNoteTextProps> {
|
|
|
21184
21198
|
fontSize: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>>;
|
|
21185
21199
|
color: zod.ZodOptional<zod.ZodString>;
|
|
21186
21200
|
}, "strip", zod.ZodTypeAny, {
|
|
21187
|
-
text: string;
|
|
21188
21201
|
anchorAlignment: "top_left" | "top_right" | "center" | "bottom_left" | "bottom_right";
|
|
21202
|
+
text: string;
|
|
21189
21203
|
pcbX?: string | number | undefined;
|
|
21190
21204
|
pcbY?: string | number | undefined;
|
|
21191
21205
|
pcbLeftEdgeX?: string | number | undefined;
|
|
@@ -21253,8 +21267,8 @@ declare class PcbNoteText extends PrimitiveComponent<typeof pcbNoteTextProps> {
|
|
|
21253
21267
|
} | undefined;
|
|
21254
21268
|
pcbRelative?: boolean | undefined;
|
|
21255
21269
|
relative?: boolean | undefined;
|
|
21256
|
-
color?: string | undefined;
|
|
21257
21270
|
anchorAlignment?: "top_left" | "top_right" | "center" | "bottom_left" | "bottom_right" | undefined;
|
|
21271
|
+
color?: string | undefined;
|
|
21258
21272
|
font?: "tscircuit2024" | undefined;
|
|
21259
21273
|
fontSize?: string | number | undefined;
|
|
21260
21274
|
}>;
|
|
@@ -24972,8 +24986,8 @@ declare class SilkscreenText extends PrimitiveComponent<typeof silkscreenTextPro
|
|
|
24972
24986
|
name: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6";
|
|
24973
24987
|
}>, "many">>;
|
|
24974
24988
|
}, "strip", zod.ZodTypeAny, {
|
|
24975
|
-
text: string;
|
|
24976
24989
|
anchorAlignment: "top_left" | "top_center" | "top_right" | "center_left" | "center" | "center_right" | "bottom_left" | "bottom_center" | "bottom_right";
|
|
24990
|
+
text: string;
|
|
24977
24991
|
pcbX?: string | number | undefined;
|
|
24978
24992
|
pcbY?: string | number | undefined;
|
|
24979
24993
|
pcbLeftEdgeX?: string | number | undefined;
|
|
@@ -43221,6 +43235,13 @@ declare const applySchematicEditEventsToManualEditsFile: ({ circuitJson, editEve
|
|
|
43221
43235
|
manualEditsFile: z.infer<typeof manual_edits_file>;
|
|
43222
43236
|
}) => z.infer<typeof manual_edits_file>;
|
|
43223
43237
|
|
|
43238
|
+
declare const SOLVERS: {
|
|
43239
|
+
PackSolver2: typeof PackSolver2;
|
|
43240
|
+
AutoroutingPipelineSolver: typeof AutoroutingPipelineSolver;
|
|
43241
|
+
AssignableViaAutoroutingPipelineSolver: typeof AssignableViaAutoroutingPipelineSolver;
|
|
43242
|
+
};
|
|
43243
|
+
type SolverName = keyof typeof SOLVERS;
|
|
43244
|
+
|
|
43224
43245
|
interface TscircuitElements {
|
|
43225
43246
|
resistor: _tscircuit_props.ResistorProps;
|
|
43226
43247
|
capacitor: _tscircuit_props.CapacitorProps;
|
|
@@ -43316,4 +43337,4 @@ declare module "react/jsx-runtime" {
|
|
|
43316
43337
|
}
|
|
43317
43338
|
}
|
|
43318
43339
|
|
|
43319
|
-
export { AnalogSimulation, type AsyncEffect, type AutorouterCompleteEvent, type AutorouterErrorEvent, type AutorouterEvent, type AutorouterProgressEvent, type AutoroutingEndEvent, type AutoroutingErrorEvent, type AutoroutingProgressEvent, type AutoroutingStartEvent, Battery, Board, Breakout, BreakoutPoint, CadAssembly, CadModel, Capacitor, Chip, Circuit, type ComponentWithPins, Constraint, CopperPour, Crystal, Cutout, type DebugLogOutputEvent, Diode, FabricationNoteDimension, FabricationNotePath, FabricationNoteRect, FabricationNoteText, Footprint, Fuse, type GenericConnectionsAndSelectorsSel, type GenericLocalAutorouter, Group, Hole, type IRenderable, Inductor, Interconnect, Jumper, Keepout, Led, type LocalCacheEngine, Mosfet, Net, NetLabel, NormalComponent, type Obstacle, type PackingEndEvent, type PackingErrorEvent, type PackingStartEvent, Panel, PcbNoteDimension, PcbNoteLine, PcbNotePath, PcbNoteRect, PcbNoteText, PcbTrace, PinHeader, type PinLabelSpec, Pinout, PlatedHole, Port, Potentiometer, PowerSource, PrimitiveComponent, Project, PushButton, type RenderPhase, type RenderPhaseFn, type RenderPhaseFunctions, type RenderPhaseStates, Renderable, Resistor, Resonator, RootCircuit, type RootCircuitEventName, SchematicArc, SchematicBox, SchematicCell, SchematicCircle, SchematicLine, SchematicRect, SchematicRow, SchematicTable, SchematicText, type Sel, SilkscreenCircle, SilkscreenLine, SilkscreenPath, SilkscreenRect, SilkscreenText, type SimpleRouteConnection, type SimpleRouteJson, type SimplifiedPcbTrace, SmtPad, SolderJumper, Subcircuit, Switch, SymbolComponent as Symbol, TestPoint, Trace, TraceHint, Transistor, Via, VoltageProbe, VoltageSource, applyEditEvents, applyEditEventsToManualEditsFile, applyPcbEditEventsToManualEditsFile, applySchematicEditEventsToManualEditsFile, createUseComponent, getPhaseTimingsFromRenderEvents, getSimpleRouteJsonFromCircuitJson, normalizePinLabels, orderedRenderPhases, resolveStaticFileImport, sel, useCapacitor, useChip, useDiode, useLed, useRenderedCircuit, useResistor };
|
|
43340
|
+
export { AnalogSimulation, type AsyncEffect, type AutorouterCompleteEvent, type AutorouterErrorEvent, type AutorouterEvent, type AutorouterProgressEvent, type AutoroutingEndEvent, type AutoroutingErrorEvent, type AutoroutingProgressEvent, type AutoroutingStartEvent, Battery, Board, Breakout, BreakoutPoint, CadAssembly, CadModel, Capacitor, Chip, Circuit, type ComponentWithPins, Constraint, CopperPour, Crystal, Cutout, type DebugLogOutputEvent, Diode, FabricationNoteDimension, FabricationNotePath, FabricationNoteRect, FabricationNoteText, Footprint, Fuse, type GenericConnectionsAndSelectorsSel, type GenericLocalAutorouter, Group, Hole, type IRenderable, Inductor, Interconnect, Jumper, Keepout, Led, type LocalCacheEngine, Mosfet, Net, NetLabel, NormalComponent, type Obstacle, type PackingEndEvent, type PackingErrorEvent, type PackingStartEvent, Panel, PcbNoteDimension, PcbNoteLine, PcbNotePath, PcbNoteRect, PcbNoteText, PcbTrace, PinHeader, type PinLabelSpec, Pinout, PlatedHole, Port, Potentiometer, PowerSource, PrimitiveComponent, Project, PushButton, type RenderPhase, type RenderPhaseFn, type RenderPhaseFunctions, type RenderPhaseStates, Renderable, Resistor, Resonator, RootCircuit, type RootCircuitEventName, SOLVERS, SchematicArc, SchematicBox, SchematicCell, SchematicCircle, SchematicLine, SchematicRect, SchematicRow, SchematicTable, SchematicText, type Sel, SilkscreenCircle, SilkscreenLine, SilkscreenPath, SilkscreenRect, SilkscreenText, type SimpleRouteConnection, type SimpleRouteJson, type SimplifiedPcbTrace, SmtPad, SolderJumper, type SolverName, type SolverStartedEvent, Subcircuit, Switch, SymbolComponent as Symbol, TestPoint, Trace, TraceHint, Transistor, Via, VoltageProbe, VoltageSource, applyEditEvents, applyEditEventsToManualEditsFile, applyPcbEditEventsToManualEditsFile, applySchematicEditEventsToManualEditsFile, createUseComponent, getPhaseTimingsFromRenderEvents, getSimpleRouteJsonFromCircuitJson, normalizePinLabels, orderedRenderPhases, resolveStaticFileImport, sel, useCapacitor, useChip, useDiode, useLed, useRenderedCircuit, useResistor };
|
package/dist/index.js
CHANGED
|
@@ -9468,7 +9468,9 @@ var NormalComponent3 = class extends PrimitiveComponent2 {
|
|
|
9468
9468
|
db.pcb_component.update(this.pcb_component_id, {
|
|
9469
9469
|
position_mode: "relative_to_group_anchor",
|
|
9470
9470
|
positioned_relative_to_pcb_group_id: positionedRelativeToGroupId,
|
|
9471
|
-
positioned_relative_to_pcb_board_id: positionedRelativeToBoardId
|
|
9471
|
+
positioned_relative_to_pcb_board_id: positionedRelativeToBoardId,
|
|
9472
|
+
display_offset_x: props.pcbX,
|
|
9473
|
+
display_offset_y: props.pcbY
|
|
9472
9474
|
});
|
|
9473
9475
|
}
|
|
9474
9476
|
/**
|
|
@@ -9573,18 +9575,30 @@ var CapacityMeshAutorouter = class {
|
|
|
9573
9575
|
capacityDepth,
|
|
9574
9576
|
targetMinCapacity,
|
|
9575
9577
|
stepDelay = 0,
|
|
9576
|
-
useAssignableViaSolver = false
|
|
9578
|
+
useAssignableViaSolver = false,
|
|
9579
|
+
onSolverStarted
|
|
9577
9580
|
} = options;
|
|
9578
9581
|
const {
|
|
9579
|
-
AutoroutingPipelineSolver,
|
|
9580
|
-
AssignableViaAutoroutingPipelineSolver
|
|
9582
|
+
AutoroutingPipelineSolver: AutoroutingPipelineSolver2,
|
|
9583
|
+
AssignableViaAutoroutingPipelineSolver: AssignableViaAutoroutingPipelineSolver2
|
|
9581
9584
|
} = CapacityAutorouter;
|
|
9582
|
-
const SolverClass = useAssignableViaSolver ?
|
|
9585
|
+
const SolverClass = useAssignableViaSolver ? AssignableViaAutoroutingPipelineSolver2 : AutoroutingPipelineSolver2;
|
|
9583
9586
|
this.solver = new SolverClass(input, {
|
|
9584
9587
|
capacityDepth,
|
|
9585
9588
|
targetMinCapacity,
|
|
9586
9589
|
cacheProvider: null
|
|
9587
9590
|
});
|
|
9591
|
+
onSolverStarted?.({
|
|
9592
|
+
solverName: SolverClass.name,
|
|
9593
|
+
solverParams: {
|
|
9594
|
+
input,
|
|
9595
|
+
options: {
|
|
9596
|
+
capacityDepth,
|
|
9597
|
+
targetMinCapacity,
|
|
9598
|
+
cacheProvider: null
|
|
9599
|
+
}
|
|
9600
|
+
}
|
|
9601
|
+
});
|
|
9588
9602
|
this.stepDelay = stepDelay;
|
|
9589
9603
|
}
|
|
9590
9604
|
/**
|
|
@@ -11895,7 +11909,7 @@ function getPresetAutoroutingConfig(autorouterConfig) {
|
|
|
11895
11909
|
|
|
11896
11910
|
// lib/components/primitive-components/Group/Group_doInitialPcbLayoutPack/Group_doInitialPcbLayoutPack.ts
|
|
11897
11911
|
import {
|
|
11898
|
-
|
|
11912
|
+
PackSolver2,
|
|
11899
11913
|
convertCircuitJsonToPackOutput,
|
|
11900
11914
|
convertPackOutputToPackInput,
|
|
11901
11915
|
getGraphicsFromPackOutput
|
|
@@ -12401,7 +12415,18 @@ var Group_doInitialPcbLayoutPack = (group) => {
|
|
|
12401
12415
|
}
|
|
12402
12416
|
let packOutput;
|
|
12403
12417
|
try {
|
|
12404
|
-
|
|
12418
|
+
const solver = new PackSolver2(packInput);
|
|
12419
|
+
group.root?.emit("solver:started", {
|
|
12420
|
+
type: "solver:started",
|
|
12421
|
+
solverName: solver.constructor.name,
|
|
12422
|
+
solverParams: solver.getConstructorParams(),
|
|
12423
|
+
componentName: group.getString()
|
|
12424
|
+
});
|
|
12425
|
+
solver.solve();
|
|
12426
|
+
packOutput = {
|
|
12427
|
+
...packInput,
|
|
12428
|
+
components: solver.packedComponents
|
|
12429
|
+
};
|
|
12405
12430
|
} catch (error) {
|
|
12406
12431
|
group.root?.emit("packing:error", {
|
|
12407
12432
|
subcircuit_id: group.subcircuit_id,
|
|
@@ -13651,7 +13676,9 @@ function Group_doInitialPcbComponentAnchorAlignment(group) {
|
|
|
13651
13676
|
}
|
|
13652
13677
|
db.pcb_group.update(group.pcb_group_id, {
|
|
13653
13678
|
anchor_position: targetPosition,
|
|
13654
|
-
anchor_alignment: pcbPositionAnchor
|
|
13679
|
+
anchor_alignment: pcbPositionAnchor,
|
|
13680
|
+
display_offset_x: pcbX,
|
|
13681
|
+
display_offset_y: pcbY
|
|
13655
13682
|
});
|
|
13656
13683
|
}
|
|
13657
13684
|
|
|
@@ -14012,7 +14039,13 @@ var Group6 = class extends NormalComponent3 {
|
|
|
14012
14039
|
// Optional configuration parameters
|
|
14013
14040
|
capacityDepth: this.props.autorouter?.capacityDepth,
|
|
14014
14041
|
targetMinCapacity: this.props.autorouter?.targetMinCapacity,
|
|
14015
|
-
useAssignableViaSolver: isLaserPrefabPreset || isSingleLayerBoard
|
|
14042
|
+
useAssignableViaSolver: isLaserPrefabPreset || isSingleLayerBoard,
|
|
14043
|
+
onSolverStarted: ({ solverName, solverParams }) => this.root?.emit("solver:started", {
|
|
14044
|
+
type: "solver:started",
|
|
14045
|
+
solverName,
|
|
14046
|
+
solverParams,
|
|
14047
|
+
componentName: this.getString()
|
|
14048
|
+
})
|
|
14016
14049
|
});
|
|
14017
14050
|
}
|
|
14018
14051
|
const routingPromise = new Promise(
|
|
@@ -14285,6 +14318,24 @@ var Group6 = class extends NormalComponent3 {
|
|
|
14285
14318
|
return "none";
|
|
14286
14319
|
}
|
|
14287
14320
|
doInitialPcbLayout() {
|
|
14321
|
+
if (this.root?.pcbDisabled) return;
|
|
14322
|
+
if (this.pcb_group_id) {
|
|
14323
|
+
const { db } = this.root;
|
|
14324
|
+
const props = this._parsedProps;
|
|
14325
|
+
const hasExplicitPcbPosition = props.pcbX !== void 0 || props.pcbY !== void 0;
|
|
14326
|
+
if (hasExplicitPcbPosition) {
|
|
14327
|
+
const parentGroup = this.parent?.getGroup?.();
|
|
14328
|
+
const pcbParentGroupId = parentGroup?.pcb_group_id ? db.pcb_group.get(parentGroup.pcb_group_id)?.pcb_group_id : void 0;
|
|
14329
|
+
const positionedRelativeToBoardId = !pcbParentGroupId ? this._getBoard()?.pcb_board_id ?? void 0 : void 0;
|
|
14330
|
+
db.pcb_group.update(this.pcb_group_id, {
|
|
14331
|
+
position_mode: "relative_to_group_anchor",
|
|
14332
|
+
positioned_relative_to_pcb_group_id: pcbParentGroupId,
|
|
14333
|
+
positioned_relative_to_pcb_board_id: positionedRelativeToBoardId,
|
|
14334
|
+
display_offset_x: props.pcbX,
|
|
14335
|
+
display_offset_y: props.pcbY
|
|
14336
|
+
});
|
|
14337
|
+
}
|
|
14338
|
+
}
|
|
14288
14339
|
const pcbLayoutMode = this._getPcbLayoutMode();
|
|
14289
14340
|
if (pcbLayoutMode === "grid") {
|
|
14290
14341
|
this._doInitialPcbLayoutGrid();
|
|
@@ -19278,7 +19329,7 @@ import { identity as identity5 } from "transformation-matrix";
|
|
|
19278
19329
|
var package_default = {
|
|
19279
19330
|
name: "@tscircuit/core",
|
|
19280
19331
|
type: "module",
|
|
19281
|
-
version: "0.0.
|
|
19332
|
+
version: "0.0.921",
|
|
19282
19333
|
types: "dist/index.d.ts",
|
|
19283
19334
|
main: "dist/index.js",
|
|
19284
19335
|
module: "dist/index.js",
|
|
@@ -19322,7 +19373,7 @@ var package_default = {
|
|
|
19322
19373
|
"@tscircuit/math-utils": "^0.0.29",
|
|
19323
19374
|
"@tscircuit/miniflex": "^0.0.4",
|
|
19324
19375
|
"@tscircuit/ngspice-spice-engine": "^0.0.8",
|
|
19325
|
-
"@tscircuit/props": "^0.0.
|
|
19376
|
+
"@tscircuit/props": "^0.0.427",
|
|
19326
19377
|
"@tscircuit/schematic-autolayout": "^0.0.6",
|
|
19327
19378
|
"@tscircuit/schematic-match-adapt": "^0.0.16",
|
|
19328
19379
|
"@tscircuit/schematic-trace-solver": "^v0.0.45",
|
|
@@ -19336,13 +19387,13 @@ var package_default = {
|
|
|
19336
19387
|
"bun-match-svg": "0.0.12",
|
|
19337
19388
|
"calculate-elbow": "^0.0.12",
|
|
19338
19389
|
"chokidar-cli": "^3.0.0",
|
|
19339
|
-
"circuit-json": "^0.0.
|
|
19390
|
+
"circuit-json": "^0.0.333",
|
|
19340
19391
|
"circuit-json-to-bpc": "^0.0.13",
|
|
19341
19392
|
"circuit-json-to-connectivity-map": "^0.0.23",
|
|
19342
19393
|
"circuit-json-to-gltf": "^0.0.31",
|
|
19343
19394
|
"circuit-json-to-simple-3d": "^0.0.9",
|
|
19344
19395
|
"circuit-json-to-spice": "^0.0.30",
|
|
19345
|
-
"circuit-to-svg": "^0.0.
|
|
19396
|
+
"circuit-to-svg": "^0.0.293",
|
|
19346
19397
|
concurrently: "^9.1.2",
|
|
19347
19398
|
"connectivity-map": "^1.0.0",
|
|
19348
19399
|
debug: "^4.3.6",
|
|
@@ -19808,6 +19859,18 @@ var sel = new Proxy(
|
|
|
19808
19859
|
}
|
|
19809
19860
|
);
|
|
19810
19861
|
|
|
19862
|
+
// lib/solvers.ts
|
|
19863
|
+
import { PackSolver2 as PackSolver22 } from "calculate-packing";
|
|
19864
|
+
import {
|
|
19865
|
+
AutoroutingPipelineSolver,
|
|
19866
|
+
AssignableViaAutoroutingPipelineSolver
|
|
19867
|
+
} from "@tscircuit/capacity-autorouter";
|
|
19868
|
+
var SOLVERS = {
|
|
19869
|
+
PackSolver2: PackSolver22,
|
|
19870
|
+
AutoroutingPipelineSolver,
|
|
19871
|
+
AssignableViaAutoroutingPipelineSolver
|
|
19872
|
+
};
|
|
19873
|
+
|
|
19811
19874
|
// lib/index.ts
|
|
19812
19875
|
import { createElement } from "react";
|
|
19813
19876
|
|
|
@@ -19869,6 +19932,7 @@ export {
|
|
|
19869
19932
|
Resistor,
|
|
19870
19933
|
Resonator,
|
|
19871
19934
|
RootCircuit,
|
|
19935
|
+
SOLVERS,
|
|
19872
19936
|
SchematicArc,
|
|
19873
19937
|
SchematicBox,
|
|
19874
19938
|
SchematicCell,
|
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.922",
|
|
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.8",
|
|
48
|
-
"@tscircuit/props": "^0.0.
|
|
48
|
+
"@tscircuit/props": "^0.0.427",
|
|
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.333",
|
|
63
63
|
"circuit-json-to-bpc": "^0.0.13",
|
|
64
64
|
"circuit-json-to-connectivity-map": "^0.0.23",
|
|
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.30",
|
|
68
|
-
"circuit-to-svg": "^0.0.
|
|
68
|
+
"circuit-to-svg": "^0.0.293",
|
|
69
69
|
"concurrently": "^9.1.2",
|
|
70
70
|
"connectivity-map": "^1.0.0",
|
|
71
71
|
"debug": "^4.3.6",
|