@tscircuit/core 0.0.1313 → 0.0.1314
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.js +44 -36
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -15718,7 +15718,7 @@ var getSimpleRouteJsonFromCircuitJson = ({
|
|
|
15718
15718
|
};
|
|
15719
15719
|
}
|
|
15720
15720
|
const routedTraceIds = new Set(
|
|
15721
|
-
db.pcb_trace.list().filter((t) =>
|
|
15721
|
+
subcircuit_id ? db.pcb_trace.list().filter((t) => t.subcircuit_id === subcircuit_id).map((t) => t.source_trace_id).filter((id) => Boolean(id)) : []
|
|
15722
15722
|
);
|
|
15723
15723
|
const sourcePortIdToBreakoutPoint = /* @__PURE__ */ new Map();
|
|
15724
15724
|
for (const bp of breakoutPoints) {
|
|
@@ -15814,22 +15814,27 @@ var getSimpleRouteJsonFromCircuitJson = ({
|
|
|
15814
15814
|
sourceTrace.min_trace_thickness
|
|
15815
15815
|
);
|
|
15816
15816
|
}
|
|
15817
|
-
|
|
15818
|
-
|
|
15819
|
-
|
|
15820
|
-
|
|
15821
|
-
|
|
15822
|
-
|
|
15823
|
-
|
|
15824
|
-
|
|
15825
|
-
return pcb_ports.map((p) => ({
|
|
15817
|
+
const pointsToConnect = [];
|
|
15818
|
+
const addedPointIds = /* @__PURE__ */ new Set();
|
|
15819
|
+
for (const st of connectedSourceTraces) {
|
|
15820
|
+
const pcb_ports = db.pcb_port.list().filter((p) => st.connected_source_port_ids.includes(p.source_port_id));
|
|
15821
|
+
for (const p of pcb_ports) {
|
|
15822
|
+
if (addedPointIds.has(p.pcb_port_id)) continue;
|
|
15823
|
+
addedPointIds.add(p.pcb_port_id);
|
|
15824
|
+
pointsToConnect.push({
|
|
15826
15825
|
x: p.x,
|
|
15827
15826
|
y: p.y,
|
|
15828
15827
|
layer: p.layers?.[0] ?? "top",
|
|
15829
15828
|
pointId: p.pcb_port_id,
|
|
15830
15829
|
pcb_port_id: p.pcb_port_id
|
|
15831
|
-
})
|
|
15832
|
-
}
|
|
15830
|
+
});
|
|
15831
|
+
}
|
|
15832
|
+
}
|
|
15833
|
+
connectionsFromNets.push({
|
|
15834
|
+
name: net.source_net_id ?? connMap.getNetConnectedToId(net.source_net_id),
|
|
15835
|
+
nominalTraceWidth: nominalTraceWidthFromConnectedTraces,
|
|
15836
|
+
width: nominalTraceWidthFromConnectedTraces,
|
|
15837
|
+
pointsToConnect
|
|
15833
15838
|
});
|
|
15834
15839
|
}
|
|
15835
15840
|
const connectionsFromBreakoutPoints = [];
|
|
@@ -15881,31 +15886,34 @@ var getSimpleRouteJsonFromCircuitJson = ({
|
|
|
15881
15886
|
...connectionsFromNets,
|
|
15882
15887
|
...connectionsFromBreakoutPoints
|
|
15883
15888
|
];
|
|
15884
|
-
|
|
15885
|
-
|
|
15886
|
-
for (const
|
|
15887
|
-
|
|
15889
|
+
if (subcircuit_id) {
|
|
15890
|
+
const pointIdToConn = /* @__PURE__ */ new Map();
|
|
15891
|
+
for (const conn of allConns) {
|
|
15892
|
+
for (const pt of conn.pointsToConnect) {
|
|
15893
|
+
if (pt.pointId) pointIdToConn.set(pt.pointId, conn);
|
|
15894
|
+
}
|
|
15895
|
+
}
|
|
15896
|
+
const existingTraces = db.pcb_trace.list().filter((t) => {
|
|
15897
|
+
return relevantSubcircuitIds?.has(t.subcircuit_id);
|
|
15898
|
+
});
|
|
15899
|
+
for (const tr of existingTraces) {
|
|
15900
|
+
const tracePortIds = /* @__PURE__ */ new Set();
|
|
15901
|
+
for (const seg of tr.route) {
|
|
15902
|
+
if (seg.start_pcb_port_id) tracePortIds.add(seg.start_pcb_port_id);
|
|
15903
|
+
if (seg.end_pcb_port_id) tracePortIds.add(seg.end_pcb_port_id);
|
|
15904
|
+
}
|
|
15905
|
+
if (tracePortIds.size < 2) continue;
|
|
15906
|
+
const firstId = tracePortIds.values().next().value;
|
|
15907
|
+
if (!firstId) continue;
|
|
15908
|
+
const conn = pointIdToConn.get(firstId);
|
|
15909
|
+
if (!conn) continue;
|
|
15910
|
+
if (![...tracePortIds].every((pid) => pointIdToConn.get(pid) === conn)) {
|
|
15911
|
+
continue;
|
|
15912
|
+
}
|
|
15913
|
+
conn.externallyConnectedPointIds ??= [];
|
|
15914
|
+
conn.externallyConnectedPointIds.push([...tracePortIds]);
|
|
15888
15915
|
}
|
|
15889
15916
|
}
|
|
15890
|
-
const existingTraces = db.pcb_trace.list().filter(
|
|
15891
|
-
(t) => !subcircuit_id || relevantSubcircuitIds?.has(t.subcircuit_id)
|
|
15892
|
-
);
|
|
15893
|
-
for (const tr of existingTraces) {
|
|
15894
|
-
const tracePortIds = /* @__PURE__ */ new Set();
|
|
15895
|
-
for (const seg of tr.route) {
|
|
15896
|
-
if (seg.start_pcb_port_id) tracePortIds.add(seg.start_pcb_port_id);
|
|
15897
|
-
if (seg.end_pcb_port_id) tracePortIds.add(seg.end_pcb_port_id);
|
|
15898
|
-
}
|
|
15899
|
-
if (tracePortIds.size < 2) continue;
|
|
15900
|
-
const firstId = tracePortIds.values().next().value;
|
|
15901
|
-
if (!firstId) continue;
|
|
15902
|
-
const conn = pointIdToConn.get(firstId);
|
|
15903
|
-
if (!conn) continue;
|
|
15904
|
-
if (![...tracePortIds].every((pid) => pointIdToConn.get(pid) === conn))
|
|
15905
|
-
continue;
|
|
15906
|
-
conn.externallyConnectedPointIds ??= [];
|
|
15907
|
-
conn.externallyConnectedPointIds.push([...tracePortIds]);
|
|
15908
|
-
}
|
|
15909
15917
|
const resolvedMinViaHoleDiameter = minViaHoleDiameter ?? board?.min_via_hole_diameter;
|
|
15910
15918
|
const resolvedMinViaPadDiameter = minViaPadDiameter ?? board?.min_via_pad_diameter;
|
|
15911
15919
|
const resolvedMinTraceToPadEdgeClearance = minTraceToPadEdgeClearance ?? board?.min_trace_to_pad_edge_clearance;
|
|
@@ -23490,7 +23498,7 @@ import { identity as identity5 } from "transformation-matrix";
|
|
|
23490
23498
|
var package_default = {
|
|
23491
23499
|
name: "@tscircuit/core",
|
|
23492
23500
|
type: "module",
|
|
23493
|
-
version: "0.0.
|
|
23501
|
+
version: "0.0.1313",
|
|
23494
23502
|
types: "dist/index.d.ts",
|
|
23495
23503
|
main: "dist/index.js",
|
|
23496
23504
|
module: "dist/index.js",
|