@tscircuit/capacity-autorouter 0.0.97 → 0.0.99
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 +28 -4
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -15760,6 +15760,12 @@ var CapacityMeshEdgeSolver = class extends BaseSolver {
|
|
|
15760
15760
|
return node1.availableZ.some((z) => node2.availableZ.includes(z));
|
|
15761
15761
|
}
|
|
15762
15762
|
visualize() {
|
|
15763
|
+
const edgeCount = /* @__PURE__ */ new Map();
|
|
15764
|
+
for (const edge of this.edges) {
|
|
15765
|
+
for (const nodeId of edge.nodeIds) {
|
|
15766
|
+
edgeCount.set(nodeId, 1 + (edgeCount.get(nodeId) ?? 0));
|
|
15767
|
+
}
|
|
15768
|
+
}
|
|
15763
15769
|
const graphics = {
|
|
15764
15770
|
lines: [],
|
|
15765
15771
|
points: [],
|
|
@@ -15781,8 +15787,10 @@ var CapacityMeshEdgeSolver = class extends BaseSolver {
|
|
|
15781
15787
|
node.capacityMeshNodeId,
|
|
15782
15788
|
`availableZ: ${node.availableZ.join(",")}`,
|
|
15783
15789
|
`target? ${node._containsTarget ?? false}`,
|
|
15784
|
-
`obs? ${node._containsObstacle ?? false}
|
|
15785
|
-
|
|
15790
|
+
`obs? ${node._containsObstacle ?? false}`,
|
|
15791
|
+
`conn: ${edgeCount.get(node.capacityMeshNodeId) ?? 0}`
|
|
15792
|
+
].join("\n"),
|
|
15793
|
+
layer: `z${node.availableZ.join(",")}`
|
|
15786
15794
|
};
|
|
15787
15795
|
}),
|
|
15788
15796
|
circles: []
|
|
@@ -15807,7 +15815,11 @@ var CapacityMeshEdgeSolver = class extends BaseSolver {
|
|
|
15807
15815
|
x: node2.center.x + lowestZ2 * node2.width * 0.05,
|
|
15808
15816
|
y: node2.center.y - lowestZ2 * node2.width * 0.05
|
|
15809
15817
|
};
|
|
15818
|
+
const availableZ = Array.from(
|
|
15819
|
+
/* @__PURE__ */ new Set([...node1.availableZ, ...node2.availableZ])
|
|
15820
|
+
).sort();
|
|
15810
15821
|
graphics.lines.push({
|
|
15822
|
+
layer: `z${availableZ.join(",")}`,
|
|
15811
15823
|
points: [nodeCenter1Adj, nodeCenter2Adj],
|
|
15812
15824
|
strokeDash: node1.availableZ.join(",") === node2.availableZ.join(",") ? void 0 : "10 5"
|
|
15813
15825
|
});
|
|
@@ -15922,6 +15934,12 @@ var DeadEndSolver = class extends BaseSolver {
|
|
|
15922
15934
|
this.nodeMap.set(node.capacityMeshNodeId, node);
|
|
15923
15935
|
}
|
|
15924
15936
|
}
|
|
15937
|
+
const edgeCount = /* @__PURE__ */ new Map();
|
|
15938
|
+
for (const edge of this.edges) {
|
|
15939
|
+
for (const nodeId of edge.nodeIds) {
|
|
15940
|
+
edgeCount.set(nodeId, 1 + (edgeCount.get(nodeId) ?? 0));
|
|
15941
|
+
}
|
|
15942
|
+
}
|
|
15925
15943
|
const graphics = {
|
|
15926
15944
|
lines: [],
|
|
15927
15945
|
points: [],
|
|
@@ -15943,8 +15961,10 @@ var DeadEndSolver = class extends BaseSolver {
|
|
|
15943
15961
|
node.capacityMeshNodeId,
|
|
15944
15962
|
`availableZ: ${node.availableZ.join(",")}`,
|
|
15945
15963
|
`target? ${node._containsTarget ?? false}`,
|
|
15946
|
-
`obs? ${node._containsObstacle ?? false}
|
|
15947
|
-
|
|
15964
|
+
`obs? ${node._containsObstacle ?? false}`,
|
|
15965
|
+
`conn: ${edgeCount.get(node.capacityMeshNodeId) ?? 0}`
|
|
15966
|
+
].join("\n"),
|
|
15967
|
+
layer: `z${node.availableZ.join(",")}`
|
|
15948
15968
|
};
|
|
15949
15969
|
}),
|
|
15950
15970
|
circles: []
|
|
@@ -15963,7 +15983,11 @@ var DeadEndSolver = class extends BaseSolver {
|
|
|
15963
15983
|
x: node2.center.x + lowestZ2 * node2.width * 0.05,
|
|
15964
15984
|
y: node2.center.y - lowestZ2 * node2.width * 0.05
|
|
15965
15985
|
};
|
|
15986
|
+
const availableZ = Array.from(
|
|
15987
|
+
/* @__PURE__ */ new Set([...node1.availableZ, ...node2.availableZ])
|
|
15988
|
+
).sort();
|
|
15966
15989
|
graphics.lines.push({
|
|
15990
|
+
layer: `z${availableZ.join(",")}`,
|
|
15967
15991
|
points: [nodeCenter1Adj, nodeCenter2Adj],
|
|
15968
15992
|
strokeDash: node1.availableZ.join(",") === node2.availableZ.join(",") ? void 0 : "10 5",
|
|
15969
15993
|
strokeColor: edge.nodeIds.some(
|