@tscircuit/core 0.0.1262 → 0.0.1263
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 +24 -4
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -17489,6 +17489,7 @@ import Debug11 from "debug";
|
|
|
17489
17489
|
|
|
17490
17490
|
// lib/components/primitive-components/Group/Group_doInitialSchematicTraceRender/createSchematicTraceSolverInputProblem.ts
|
|
17491
17491
|
import "@tscircuit/schematic-trace-solver";
|
|
17492
|
+
var DEFAULT_MAX_MSP_PAIR_DISTANCE = 2.4;
|
|
17492
17493
|
function createSchematicTraceSolverInputProblem(group) {
|
|
17493
17494
|
const { db } = group.root;
|
|
17494
17495
|
const connKeyToSourceNet = /* @__PURE__ */ new Map();
|
|
@@ -17613,9 +17614,28 @@ function createSchematicTraceSolverInputProblem(group) {
|
|
|
17613
17614
|
if (st.subcircuit_connectivity_map_key) {
|
|
17614
17615
|
userNetIdToConnKey.set(userNetId, st.subcircuit_connectivity_map_key);
|
|
17615
17616
|
}
|
|
17617
|
+
const portA = db.schematic_port.get(a);
|
|
17618
|
+
const portB = db.schematic_port.get(b);
|
|
17619
|
+
let portDistance = 0;
|
|
17620
|
+
if (portA && portB) {
|
|
17621
|
+
portDistance = Math.sqrt(
|
|
17622
|
+
(portA.center.x - portB.center.x) ** 2 + (portA.center.y - portB.center.y) ** 2
|
|
17623
|
+
);
|
|
17624
|
+
}
|
|
17625
|
+
const maxMspDist = group._parsedProps.schMaxTraceDistance ?? DEFAULT_MAX_MSP_PAIR_DISTANCE;
|
|
17626
|
+
let netLabelWidth;
|
|
17627
|
+
if (st.display_name && !st.display_name.startsWith(".") && portDistance > maxMspDist) {
|
|
17628
|
+
netLabelWidth = Number(
|
|
17629
|
+
getSchematicNetLabelTextWidth({
|
|
17630
|
+
text: String(st.display_name),
|
|
17631
|
+
font_size: 0.14
|
|
17632
|
+
}).toFixed(2)
|
|
17633
|
+
);
|
|
17634
|
+
}
|
|
17616
17635
|
directConnections.push({
|
|
17617
17636
|
pinIds: [a, b].map((id) => schematicPortIdToPinId.get(id)),
|
|
17618
|
-
netId: userNetId
|
|
17637
|
+
netId: userNetId,
|
|
17638
|
+
netLabelWidth
|
|
17619
17639
|
});
|
|
17620
17640
|
}
|
|
17621
17641
|
}
|
|
@@ -17678,7 +17698,7 @@ function createSchematicTraceSolverInputProblem(group) {
|
|
|
17678
17698
|
directConnections,
|
|
17679
17699
|
netConnections,
|
|
17680
17700
|
availableNetLabelOrientations,
|
|
17681
|
-
maxMspPairDistance: group._parsedProps.schMaxTraceDistance ??
|
|
17701
|
+
maxMspPairDistance: group._parsedProps.schMaxTraceDistance ?? DEFAULT_MAX_MSP_PAIR_DISTANCE
|
|
17682
17702
|
};
|
|
17683
17703
|
return {
|
|
17684
17704
|
inputProblem,
|
|
@@ -21508,7 +21528,7 @@ import { identity as identity5 } from "transformation-matrix";
|
|
|
21508
21528
|
var package_default = {
|
|
21509
21529
|
name: "@tscircuit/core",
|
|
21510
21530
|
type: "module",
|
|
21511
|
-
version: "0.0.
|
|
21531
|
+
version: "0.0.1262",
|
|
21512
21532
|
types: "dist/index.d.ts",
|
|
21513
21533
|
main: "dist/index.js",
|
|
21514
21534
|
module: "dist/index.js",
|
|
@@ -21557,7 +21577,7 @@ var package_default = {
|
|
|
21557
21577
|
"@tscircuit/ngspice-spice-engine": "^0.0.8",
|
|
21558
21578
|
"@tscircuit/props": "^0.0.536",
|
|
21559
21579
|
"@tscircuit/schematic-match-adapt": "^0.0.16",
|
|
21560
|
-
"@tscircuit/schematic-trace-solver": "^0.0.
|
|
21580
|
+
"@tscircuit/schematic-trace-solver": "^0.0.60",
|
|
21561
21581
|
"@tscircuit/solver-utils": "^0.0.3",
|
|
21562
21582
|
"@tscircuit/soup-util": "^0.0.41",
|
|
21563
21583
|
"@types/bun": "^1.2.16",
|
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.1263",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"module": "dist/index.js",
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
"@tscircuit/ngspice-spice-engine": "^0.0.8",
|
|
51
51
|
"@tscircuit/props": "^0.0.536",
|
|
52
52
|
"@tscircuit/schematic-match-adapt": "^0.0.16",
|
|
53
|
-
"@tscircuit/schematic-trace-solver": "^0.0.
|
|
53
|
+
"@tscircuit/schematic-trace-solver": "^0.0.60",
|
|
54
54
|
"@tscircuit/solver-utils": "^0.0.3",
|
|
55
55
|
"@tscircuit/soup-util": "^0.0.41",
|
|
56
56
|
"@types/bun": "^1.2.16",
|