@tscircuit/core 0.0.1469 → 0.0.1470
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 +2 -2
- package/dist/index.js +8 -45
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -35,11 +35,11 @@ declare const SOLVERS: {
|
|
|
35
35
|
};
|
|
36
36
|
type SolverName = keyof typeof SOLVERS;
|
|
37
37
|
|
|
38
|
-
type SimplifiedPcbTrace = Omit<SimplifiedPcbTrace$1, "connection_name" | "
|
|
38
|
+
type SimplifiedPcbTrace = Omit<SimplifiedPcbTrace$1, "connection_name" | "route"> & {
|
|
39
39
|
type: "pcb_trace";
|
|
40
40
|
pcb_trace_id: string;
|
|
41
41
|
connection_name?: string;
|
|
42
|
-
|
|
42
|
+
connectsTo?: string[];
|
|
43
43
|
route: Array<{
|
|
44
44
|
route_type: "wire";
|
|
45
45
|
x: number;
|
package/dist/index.js
CHANGED
|
@@ -16477,54 +16477,23 @@ var getDifferentialPairsForSimpleRouteJson = ({
|
|
|
16477
16477
|
|
|
16478
16478
|
// lib/utils/autorouting/getPreservedRoutedSubcircuitTraces.ts
|
|
16479
16479
|
var getPreservedTraceConnectionName = (trace) => trace.source_trace_id ?? trace.connection_name ?? trace.pcb_trace_id;
|
|
16480
|
-
var
|
|
16481
|
-
trace
|
|
16482
|
-
connectionName,
|
|
16483
|
-
scopedDb,
|
|
16484
|
-
sharedConnMap
|
|
16485
|
-
}) => {
|
|
16486
|
-
const connectedToIds = /* @__PURE__ */ new Set();
|
|
16487
|
-
const addConnectedId = (id) => {
|
|
16488
|
-
if (!id) return;
|
|
16489
|
-
connectedToIds.add(id);
|
|
16490
|
-
const connectivityNetId = sharedConnMap.getNetConnectedToId(id);
|
|
16491
|
-
if (!connectivityNetId) return;
|
|
16492
|
-
connectedToIds.add(connectivityNetId);
|
|
16493
|
-
for (const connectedId of sharedConnMap.getIdsConnectedToNet(
|
|
16494
|
-
connectivityNetId
|
|
16495
|
-
)) {
|
|
16496
|
-
connectedToIds.add(connectedId);
|
|
16497
|
-
}
|
|
16498
|
-
};
|
|
16499
|
-
addConnectedId(connectionName);
|
|
16500
|
-
addConnectedId(trace.source_trace_id);
|
|
16501
|
-
const sourceTrace = trace.source_trace_id ? scopedDb.source_trace.get(trace.source_trace_id) : null;
|
|
16502
|
-
if (sourceTrace) {
|
|
16503
|
-
for (const id of sourceTrace.connected_source_net_ids ?? []) {
|
|
16504
|
-
addConnectedId(id);
|
|
16505
|
-
}
|
|
16506
|
-
for (const id of sourceTrace.connected_source_port_ids ?? []) {
|
|
16507
|
-
addConnectedId(id);
|
|
16508
|
-
}
|
|
16509
|
-
}
|
|
16480
|
+
var getPhysicalConnectionIdsForPreservedTrace = (trace) => {
|
|
16481
|
+
const physicallyConnectedIds = new Set(trace.connectsTo ?? []);
|
|
16510
16482
|
for (const routePoint of trace.route ?? []) {
|
|
16511
16483
|
if (routePoint.route_type !== "wire") continue;
|
|
16512
16484
|
for (const pcbPortId of [
|
|
16513
16485
|
routePoint.start_pcb_port_id,
|
|
16514
16486
|
routePoint.end_pcb_port_id
|
|
16515
16487
|
]) {
|
|
16516
|
-
|
|
16517
|
-
const pcbPort = pcbPortId ? scopedDb.pcb_port.get(pcbPortId) : null;
|
|
16518
|
-
addConnectedId(pcbPort?.source_port_id);
|
|
16488
|
+
if (pcbPortId) physicallyConnectedIds.add(pcbPortId);
|
|
16519
16489
|
}
|
|
16520
16490
|
}
|
|
16521
|
-
return Array.from(
|
|
16491
|
+
return Array.from(physicallyConnectedIds);
|
|
16522
16492
|
};
|
|
16523
16493
|
var getPreservedRoutedSubcircuitTraces = ({
|
|
16524
16494
|
scopedDb,
|
|
16525
16495
|
currentSubcircuitId,
|
|
16526
|
-
relevantSubcircuitIds
|
|
16527
|
-
sharedConnMap
|
|
16496
|
+
relevantSubcircuitIds
|
|
16528
16497
|
}) => scopedDb.pcb_trace.list().filter((trace) => {
|
|
16529
16498
|
if (!trace.subcircuit_id) return false;
|
|
16530
16499
|
if (!currentSubcircuitId) return true;
|
|
@@ -16537,12 +16506,7 @@ var getPreservedRoutedSubcircuitTraces = ({
|
|
|
16537
16506
|
pcb_trace_id: trace.pcb_trace_id,
|
|
16538
16507
|
source_trace_id: trace.source_trace_id,
|
|
16539
16508
|
connection_name: connectionName,
|
|
16540
|
-
|
|
16541
|
-
trace: preservedTrace,
|
|
16542
|
-
connectionName,
|
|
16543
|
-
scopedDb,
|
|
16544
|
-
sharedConnMap
|
|
16545
|
-
}),
|
|
16509
|
+
connectsTo: getPhysicalConnectionIdsForPreservedTrace(preservedTrace),
|
|
16546
16510
|
route: trace.route
|
|
16547
16511
|
};
|
|
16548
16512
|
}).filter((trace) => trace.route.length >= 2);
|
|
@@ -16748,8 +16712,7 @@ var getSimpleRouteJsonFromCircuitJson = ({
|
|
|
16748
16712
|
const preservedRoutedSubcircuitTraces = getPreservedRoutedSubcircuitTraces({
|
|
16749
16713
|
scopedDb: db,
|
|
16750
16714
|
currentSubcircuitId: subcircuit_id,
|
|
16751
|
-
relevantSubcircuitIds
|
|
16752
|
-
sharedConnMap
|
|
16715
|
+
relevantSubcircuitIds
|
|
16753
16716
|
});
|
|
16754
16717
|
for (const obstacle of obstacles) {
|
|
16755
16718
|
const additionalIds = obstacle.connectedTo.flatMap(
|
|
@@ -22938,7 +22901,7 @@ function Group_getRoutingPhasePlans(group) {
|
|
|
22938
22901
|
var package_default = {
|
|
22939
22902
|
name: "@tscircuit/core",
|
|
22940
22903
|
type: "module",
|
|
22941
|
-
version: "0.0.
|
|
22904
|
+
version: "0.0.1469",
|
|
22942
22905
|
types: "dist/index.d.ts",
|
|
22943
22906
|
main: "dist/index.js",
|
|
22944
22907
|
module: "dist/index.js",
|