@tscircuit/core 0.0.535 → 0.0.537
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 +3 -0
- package/dist/index.js +42 -11
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -145,7 +145,10 @@ interface SimpleRouteConnection {
|
|
|
145
145
|
x: number;
|
|
146
146
|
y: number;
|
|
147
147
|
layer: string;
|
|
148
|
+
pointId?: string;
|
|
149
|
+
pcb_port_id?: string;
|
|
148
150
|
}>;
|
|
151
|
+
externallyConnectedPointIds?: string[][];
|
|
149
152
|
}
|
|
150
153
|
interface SimpleRouteJson {
|
|
151
154
|
layerCount: number;
|
package/dist/index.js
CHANGED
|
@@ -7022,13 +7022,17 @@ var getSimpleRouteJsonFromCircuitJson = ({
|
|
|
7022
7022
|
{
|
|
7023
7023
|
x: portA.x,
|
|
7024
7024
|
y: portA.y,
|
|
7025
|
-
layer: layerA
|
|
7025
|
+
layer: layerA,
|
|
7026
|
+
pointId: portA.pcb_port_id,
|
|
7027
|
+
pcb_port_id: portA.pcb_port_id
|
|
7026
7028
|
},
|
|
7027
7029
|
...hintPoints,
|
|
7028
7030
|
{
|
|
7029
7031
|
x: portB.x,
|
|
7030
7032
|
y: portB.y,
|
|
7031
|
-
layer: layerB
|
|
7033
|
+
layer: layerB,
|
|
7034
|
+
pointId: portB.pcb_port_id,
|
|
7035
|
+
pcb_port_id: portB.pcb_port_id
|
|
7032
7036
|
}
|
|
7033
7037
|
]
|
|
7034
7038
|
};
|
|
@@ -7052,6 +7056,7 @@ var getSimpleRouteJsonFromCircuitJson = ({
|
|
|
7052
7056
|
x: p.x,
|
|
7053
7057
|
y: p.y,
|
|
7054
7058
|
layer: p.layers?.[0] ?? "top",
|
|
7059
|
+
pointId: p.pcb_port_id,
|
|
7055
7060
|
pcb_port_id: p.pcb_port_id
|
|
7056
7061
|
}));
|
|
7057
7062
|
})
|
|
@@ -7101,6 +7106,7 @@ var getSimpleRouteJsonFromCircuitJson = ({
|
|
|
7101
7106
|
x: pcb_port.x,
|
|
7102
7107
|
y: pcb_port.y,
|
|
7103
7108
|
layer: pcb_port.layers?.[0] ?? "top",
|
|
7109
|
+
pointId: pcb_port.pcb_port_id,
|
|
7104
7110
|
// @ts-ignore
|
|
7105
7111
|
pcb_port_id: pcb_port.pcb_port_id
|
|
7106
7112
|
},
|
|
@@ -7110,15 +7116,41 @@ var getSimpleRouteJsonFromCircuitJson = ({
|
|
|
7110
7116
|
}
|
|
7111
7117
|
}
|
|
7112
7118
|
}
|
|
7119
|
+
const allConns = [
|
|
7120
|
+
...directTraceConnections,
|
|
7121
|
+
...connectionsFromNets,
|
|
7122
|
+
...connectionsFromBreakoutPoints
|
|
7123
|
+
];
|
|
7124
|
+
const pointIdToConn = /* @__PURE__ */ new Map();
|
|
7125
|
+
for (const conn of allConns) {
|
|
7126
|
+
for (const pt of conn.pointsToConnect) {
|
|
7127
|
+
if (pt.pointId) pointIdToConn.set(pt.pointId, conn);
|
|
7128
|
+
}
|
|
7129
|
+
}
|
|
7130
|
+
const existingTraces = db.pcb_trace.list().filter(
|
|
7131
|
+
(t) => !subcircuit_id || relevantSubcircuitIds?.has(t.subcircuit_id)
|
|
7132
|
+
);
|
|
7133
|
+
for (const tr of existingTraces) {
|
|
7134
|
+
const tracePortIds = /* @__PURE__ */ new Set();
|
|
7135
|
+
for (const seg of tr.route) {
|
|
7136
|
+
if (seg.start_pcb_port_id) tracePortIds.add(seg.start_pcb_port_id);
|
|
7137
|
+
if (seg.end_pcb_port_id) tracePortIds.add(seg.end_pcb_port_id);
|
|
7138
|
+
}
|
|
7139
|
+
if (tracePortIds.size < 2) continue;
|
|
7140
|
+
const firstId = tracePortIds.values().next().value;
|
|
7141
|
+
if (!firstId) continue;
|
|
7142
|
+
const conn = pointIdToConn.get(firstId);
|
|
7143
|
+
if (!conn) continue;
|
|
7144
|
+
if (![...tracePortIds].every((pid) => pointIdToConn.get(pid) === conn))
|
|
7145
|
+
continue;
|
|
7146
|
+
conn.externallyConnectedPointIds ??= [];
|
|
7147
|
+
conn.externallyConnectedPointIds.push([...tracePortIds]);
|
|
7148
|
+
}
|
|
7113
7149
|
return {
|
|
7114
7150
|
simpleRouteJson: {
|
|
7115
7151
|
bounds,
|
|
7116
7152
|
obstacles,
|
|
7117
|
-
connections:
|
|
7118
|
-
...directTraceConnections,
|
|
7119
|
-
...connectionsFromNets,
|
|
7120
|
-
...connectionsFromBreakoutPoints
|
|
7121
|
-
],
|
|
7153
|
+
connections: allConns,
|
|
7122
7154
|
// TODO add traces so that we don't run into things routed by another
|
|
7123
7155
|
// subcircuit
|
|
7124
7156
|
layerCount: 2,
|
|
@@ -7240,14 +7272,13 @@ import {
|
|
|
7240
7272
|
// lib/components/primitive-components/Group/Group_doInitialSchematicLayoutMatchAdapt.ts
|
|
7241
7273
|
import "@tscircuit/circuit-json-util";
|
|
7242
7274
|
import "circuit-json-to-connectivity-map";
|
|
7243
|
-
import corpus from "@tscircuit/schematic-corpus/dist/bundled-bpc-graphs.json";
|
|
7275
|
+
import corpus from "@tscircuit/schematic-corpus/dist/bundled-bpc-graphs.json" with { type: "json" };
|
|
7244
7276
|
import { convertCircuitJsonToBpc } from "circuit-json-to-bpc";
|
|
7245
7277
|
import {
|
|
7246
7278
|
assignFloatingBoxPositions,
|
|
7247
7279
|
netAdaptBpcGraph,
|
|
7248
7280
|
getBpcGraphWlDistance
|
|
7249
7281
|
} from "bpc-graph";
|
|
7250
|
-
import "@tscircuit/circuit-json-util";
|
|
7251
7282
|
function Group_doInitialSchematicLayoutMatchAdapt(group) {
|
|
7252
7283
|
const { db } = group.root;
|
|
7253
7284
|
const subtreeCircuitJson = structuredClone(db.toArray());
|
|
@@ -10666,7 +10697,7 @@ import { identity as identity4 } from "transformation-matrix";
|
|
|
10666
10697
|
var package_default = {
|
|
10667
10698
|
name: "@tscircuit/core",
|
|
10668
10699
|
type: "module",
|
|
10669
|
-
version: "0.0.
|
|
10700
|
+
version: "0.0.536",
|
|
10670
10701
|
types: "dist/index.d.ts",
|
|
10671
10702
|
main: "dist/index.js",
|
|
10672
10703
|
module: "dist/index.js",
|
|
@@ -10689,7 +10720,7 @@ var package_default = {
|
|
|
10689
10720
|
},
|
|
10690
10721
|
devDependencies: {
|
|
10691
10722
|
"@biomejs/biome": "^1.8.3",
|
|
10692
|
-
"@tscircuit/capacity-autorouter": "^0.0.
|
|
10723
|
+
"@tscircuit/capacity-autorouter": "^0.0.89",
|
|
10693
10724
|
"@tscircuit/checks": "^0.0.52",
|
|
10694
10725
|
"@tscircuit/circuit-json-util": "^0.0.50",
|
|
10695
10726
|
"@tscircuit/footprinter": "^0.0.186",
|
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.537",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"module": "dist/index.js",
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
},
|
|
25
25
|
"devDependencies": {
|
|
26
26
|
"@biomejs/biome": "^1.8.3",
|
|
27
|
-
"@tscircuit/capacity-autorouter": "^0.0.
|
|
27
|
+
"@tscircuit/capacity-autorouter": "^0.0.89",
|
|
28
28
|
"@tscircuit/checks": "^0.0.52",
|
|
29
29
|
"@tscircuit/circuit-json-util": "^0.0.50",
|
|
30
30
|
"@tscircuit/footprinter": "^0.0.186",
|