@tscircuit/core 0.0.1980 → 0.0.1981
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 +10 -16
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -5466,21 +5466,15 @@ import {
|
|
|
5466
5466
|
|
|
5467
5467
|
// lib/components/primitive-components/Trace/trace-utils/compute-trace-length.ts
|
|
5468
5468
|
function getTraceLength(route) {
|
|
5469
|
-
|
|
5470
|
-
|
|
5471
|
-
|
|
5472
|
-
|
|
5473
|
-
|
|
5474
|
-
|
|
5475
|
-
|
|
5476
|
-
|
|
5477
|
-
|
|
5478
|
-
const dy = nextPosition.y - position.y;
|
|
5479
|
-
totalLength += Math.sqrt(dx * dx + dy * dy);
|
|
5480
|
-
}
|
|
5481
|
-
} else if (point6.route_type === "via") {
|
|
5482
|
-
totalLength += 1.6;
|
|
5483
|
-
}
|
|
5469
|
+
const routePositions = route.flatMap(getRoutePointPositions);
|
|
5470
|
+
let totalLength = route.filter(({ route_type }) => route_type === "via").length * 1.6;
|
|
5471
|
+
for (let i = 1; i < routePositions.length; i++) {
|
|
5472
|
+
const previousPosition = routePositions[i - 1];
|
|
5473
|
+
const position = routePositions[i];
|
|
5474
|
+
totalLength += Math.hypot(
|
|
5475
|
+
position.x - previousPosition.x,
|
|
5476
|
+
position.y - previousPosition.y
|
|
5477
|
+
);
|
|
5484
5478
|
}
|
|
5485
5479
|
return totalLength;
|
|
5486
5480
|
}
|
|
@@ -64021,7 +64015,7 @@ function Group_getRoutingPhasePlans(group) {
|
|
|
64021
64015
|
var package_default = {
|
|
64022
64016
|
name: "@tscircuit/core",
|
|
64023
64017
|
type: "module",
|
|
64024
|
-
version: "0.0.
|
|
64018
|
+
version: "0.0.1980",
|
|
64025
64019
|
types: "dist/index.d.ts",
|
|
64026
64020
|
main: "dist/index.js",
|
|
64027
64021
|
module: "dist/index.js",
|