@tscircuit/core 0.0.930 → 0.0.932
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 +11 -11
- package/dist/index.js +35 -19
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -10,10 +10,10 @@ import { z, ZodType } from 'zod';
|
|
|
10
10
|
import { symbols, SchSymbol, BaseSymbolName } from 'schematic-symbols';
|
|
11
11
|
import { Matrix } from 'transformation-matrix';
|
|
12
12
|
import { CircuitJsonUtilObjects } from '@tscircuit/circuit-json-util';
|
|
13
|
-
import { ConnectivityMap } from 'circuit-json-to-connectivity-map';
|
|
14
|
-
import { GraphicsObject } from 'graphics-debug';
|
|
15
13
|
import { PackSolver2 } from 'calculate-packing';
|
|
16
14
|
import { AutoroutingPipelineSolver, AssignableViaAutoroutingPipelineSolver } from '@tscircuit/capacity-autorouter';
|
|
15
|
+
import { ConnectivityMap } from 'circuit-json-to-connectivity-map';
|
|
16
|
+
import { GraphicsObject } from 'graphics-debug';
|
|
17
17
|
|
|
18
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"];
|
|
19
19
|
type RenderPhase = (typeof orderedRenderPhases)[number];
|
|
@@ -123,6 +123,13 @@ interface BoardI {
|
|
|
123
123
|
pcb_board_id?: string | null;
|
|
124
124
|
}
|
|
125
125
|
|
|
126
|
+
declare const SOLVERS: {
|
|
127
|
+
PackSolver2: typeof PackSolver2;
|
|
128
|
+
AutoroutingPipelineSolver: typeof AutoroutingPipelineSolver;
|
|
129
|
+
AssignableViaAutoroutingPipelineSolver: typeof AssignableViaAutoroutingPipelineSolver;
|
|
130
|
+
};
|
|
131
|
+
type SolverName = keyof typeof SOLVERS;
|
|
132
|
+
|
|
126
133
|
type SimplifiedPcbTrace = {
|
|
127
134
|
type: "pcb_trace";
|
|
128
135
|
pcb_trace_id: string;
|
|
@@ -234,8 +241,8 @@ interface PackingErrorEvent {
|
|
|
234
241
|
}
|
|
235
242
|
interface SolverStartedEvent {
|
|
236
243
|
type: "solver:started";
|
|
237
|
-
solverName:
|
|
238
|
-
solverParams:
|
|
244
|
+
solverName: keyof typeof SOLVERS;
|
|
245
|
+
solverParams: any;
|
|
239
246
|
componentName: string;
|
|
240
247
|
}
|
|
241
248
|
interface DebugLogOutputEvent {
|
|
@@ -44548,13 +44555,6 @@ declare const applySchematicEditEventsToManualEditsFile: ({ circuitJson, editEve
|
|
|
44548
44555
|
manualEditsFile: z.infer<typeof manual_edits_file>;
|
|
44549
44556
|
}) => z.infer<typeof manual_edits_file>;
|
|
44550
44557
|
|
|
44551
|
-
declare const SOLVERS: {
|
|
44552
|
-
PackSolver2: typeof PackSolver2;
|
|
44553
|
-
AutoroutingPipelineSolver: typeof AutoroutingPipelineSolver;
|
|
44554
|
-
AssignableViaAutoroutingPipelineSolver: typeof AssignableViaAutoroutingPipelineSolver;
|
|
44555
|
-
};
|
|
44556
|
-
type SolverName = keyof typeof SOLVERS;
|
|
44557
|
-
|
|
44558
44558
|
interface TscircuitElements {
|
|
44559
44559
|
resistor: _tscircuit_props.ResistorProps;
|
|
44560
44560
|
capacitor: _tscircuit_props.CapacitorProps;
|
package/dist/index.js
CHANGED
|
@@ -9556,6 +9556,20 @@ import {
|
|
|
9556
9556
|
|
|
9557
9557
|
// lib/utils/autorouting/CapacityMeshAutorouter.ts
|
|
9558
9558
|
import * as CapacityAutorouter from "@tscircuit/capacity-autorouter";
|
|
9559
|
+
|
|
9560
|
+
// lib/solvers.ts
|
|
9561
|
+
import { PackSolver2 } from "calculate-packing";
|
|
9562
|
+
import {
|
|
9563
|
+
AutoroutingPipelineSolver,
|
|
9564
|
+
AssignableViaAutoroutingPipelineSolver
|
|
9565
|
+
} from "@tscircuit/capacity-autorouter";
|
|
9566
|
+
var SOLVERS = {
|
|
9567
|
+
PackSolver2,
|
|
9568
|
+
AutoroutingPipelineSolver,
|
|
9569
|
+
AssignableViaAutoroutingPipelineSolver
|
|
9570
|
+
};
|
|
9571
|
+
|
|
9572
|
+
// lib/utils/autorouting/CapacityMeshAutorouter.ts
|
|
9559
9573
|
var CapacityMeshAutorouter = class {
|
|
9560
9574
|
input;
|
|
9561
9575
|
isRouting = false;
|
|
@@ -9581,14 +9595,15 @@ var CapacityMeshAutorouter = class {
|
|
|
9581
9595
|
AutoroutingPipelineSolver: AutoroutingPipelineSolver2,
|
|
9582
9596
|
AssignableViaAutoroutingPipelineSolver: AssignableViaAutoroutingPipelineSolver2
|
|
9583
9597
|
} = CapacityAutorouter;
|
|
9584
|
-
const
|
|
9598
|
+
const solverName = useAssignableViaSolver ? "AssignableViaAutoroutingPipelineSolver" : "AutoroutingPipelineSolver";
|
|
9599
|
+
const SolverClass = SOLVERS[solverName];
|
|
9585
9600
|
this.solver = new SolverClass(input, {
|
|
9586
9601
|
capacityDepth,
|
|
9587
9602
|
targetMinCapacity,
|
|
9588
9603
|
cacheProvider: null
|
|
9589
9604
|
});
|
|
9590
9605
|
onSolverStarted?.({
|
|
9591
|
-
solverName
|
|
9606
|
+
solverName,
|
|
9592
9607
|
solverParams: {
|
|
9593
9608
|
input,
|
|
9594
9609
|
options: {
|
|
@@ -10027,7 +10042,19 @@ var getSimpleRouteJsonFromCircuitJson = ({
|
|
|
10027
10042
|
const subcircuitElements = (circuitJson ?? db.toArray()).filter(
|
|
10028
10043
|
(e) => !subcircuit_id || "subcircuit_id" in e && relevantSubcircuitIds.has(e.subcircuit_id)
|
|
10029
10044
|
);
|
|
10030
|
-
|
|
10045
|
+
let board = null;
|
|
10046
|
+
if (subcircuit_id) {
|
|
10047
|
+
const source_group_id = subcircuit_id.replace(/^subcircuit_/, "");
|
|
10048
|
+
const source_board = db.source_board.getWhere({ source_group_id });
|
|
10049
|
+
if (source_board) {
|
|
10050
|
+
board = db.pcb_board.getWhere({
|
|
10051
|
+
source_board_id: source_board.source_board_id
|
|
10052
|
+
});
|
|
10053
|
+
}
|
|
10054
|
+
}
|
|
10055
|
+
if (!board) {
|
|
10056
|
+
board = db.pcb_board.list()[0];
|
|
10057
|
+
}
|
|
10031
10058
|
db = su4(subcircuitElements);
|
|
10032
10059
|
const connMap = getFullConnectivityMapFromCircuitJson3(subcircuitElements);
|
|
10033
10060
|
const obstacles = getObstaclesFromCircuitJson(
|
|
@@ -11908,7 +11935,7 @@ function getPresetAutoroutingConfig(autorouterConfig) {
|
|
|
11908
11935
|
|
|
11909
11936
|
// lib/components/primitive-components/Group/Group_doInitialPcbLayoutPack/Group_doInitialPcbLayoutPack.ts
|
|
11910
11937
|
import {
|
|
11911
|
-
PackSolver2,
|
|
11938
|
+
PackSolver2 as PackSolver22,
|
|
11912
11939
|
convertCircuitJsonToPackOutput,
|
|
11913
11940
|
convertPackOutputToPackInput,
|
|
11914
11941
|
getGraphicsFromPackOutput
|
|
@@ -12414,10 +12441,10 @@ var Group_doInitialPcbLayoutPack = (group) => {
|
|
|
12414
12441
|
}
|
|
12415
12442
|
let packOutput;
|
|
12416
12443
|
try {
|
|
12417
|
-
const solver = new
|
|
12444
|
+
const solver = new PackSolver22(packInput);
|
|
12418
12445
|
group.root?.emit("solver:started", {
|
|
12419
12446
|
type: "solver:started",
|
|
12420
|
-
solverName:
|
|
12447
|
+
solverName: "PackSolver2",
|
|
12421
12448
|
solverParams: solver.getConstructorParams(),
|
|
12422
12449
|
componentName: group.getString()
|
|
12423
12450
|
});
|
|
@@ -15809,6 +15836,7 @@ var Board = class extends Group6 {
|
|
|
15809
15836
|
);
|
|
15810
15837
|
}
|
|
15811
15838
|
const pcb_board = db.pcb_board.insert({
|
|
15839
|
+
source_board_id: this.source_board_id,
|
|
15812
15840
|
center,
|
|
15813
15841
|
thickness: this.boardThickness,
|
|
15814
15842
|
num_layers: this.allLayers.length,
|
|
@@ -19632,7 +19660,7 @@ import { identity as identity5 } from "transformation-matrix";
|
|
|
19632
19660
|
var package_default = {
|
|
19633
19661
|
name: "@tscircuit/core",
|
|
19634
19662
|
type: "module",
|
|
19635
|
-
version: "0.0.
|
|
19663
|
+
version: "0.0.931",
|
|
19636
19664
|
types: "dist/index.d.ts",
|
|
19637
19665
|
main: "dist/index.js",
|
|
19638
19666
|
module: "dist/index.js",
|
|
@@ -20162,18 +20190,6 @@ var sel = new Proxy(
|
|
|
20162
20190
|
}
|
|
20163
20191
|
);
|
|
20164
20192
|
|
|
20165
|
-
// lib/solvers.ts
|
|
20166
|
-
import { PackSolver2 as PackSolver22 } from "calculate-packing";
|
|
20167
|
-
import {
|
|
20168
|
-
AutoroutingPipelineSolver,
|
|
20169
|
-
AssignableViaAutoroutingPipelineSolver
|
|
20170
|
-
} from "@tscircuit/capacity-autorouter";
|
|
20171
|
-
var SOLVERS = {
|
|
20172
|
-
PackSolver2: PackSolver22,
|
|
20173
|
-
AutoroutingPipelineSolver,
|
|
20174
|
-
AssignableViaAutoroutingPipelineSolver
|
|
20175
|
-
};
|
|
20176
|
-
|
|
20177
20193
|
// lib/index.ts
|
|
20178
20194
|
import { createElement } from "react";
|
|
20179
20195
|
|