@tscircuit/core 0.0.268 → 0.0.269
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 -5
- package/package.json +2 -1
package/dist/index.js
CHANGED
|
@@ -4189,10 +4189,10 @@ var getOtherSchematicTraces = ({
|
|
|
4189
4189
|
// lib/components/primitive-components/Trace/create-schematic-trace-crossing-segments.ts
|
|
4190
4190
|
import { getUnitVectorFromPointAToB } from "@tscircuit/math-utils";
|
|
4191
4191
|
var createSchematicTraceCrossingSegments = ({
|
|
4192
|
-
edges,
|
|
4192
|
+
edges: inputEdges,
|
|
4193
4193
|
otherEdges
|
|
4194
4194
|
}) => {
|
|
4195
|
-
edges = [...
|
|
4195
|
+
const edges = [...inputEdges];
|
|
4196
4196
|
for (let i = 0; i < edges.length; i++) {
|
|
4197
4197
|
if (i > 2e3) {
|
|
4198
4198
|
throw new Error(
|
|
@@ -4200,11 +4200,16 @@ var createSchematicTraceCrossingSegments = ({
|
|
|
4200
4200
|
);
|
|
4201
4201
|
}
|
|
4202
4202
|
const edge = edges[i];
|
|
4203
|
-
const edgeOrientation = Math.abs(edge.from.x - edge.to.x) < 0.01 ? "vertical" : "horizontal";
|
|
4203
|
+
const edgeOrientation = Math.abs(edge.from.x - edge.to.x) < 0.01 ? "vertical" : edge.from.y === edge.to.y ? "horizontal" : "not-orthogonal";
|
|
4204
|
+
if (edgeOrientation === "not-orthogonal") {
|
|
4205
|
+
continue;
|
|
4206
|
+
}
|
|
4204
4207
|
const otherEdgesIntersections = [];
|
|
4205
4208
|
for (const otherEdge of otherEdges) {
|
|
4206
|
-
const otherOrientation = otherEdge.from.x === otherEdge.to.x ? "vertical" : "horizontal";
|
|
4207
|
-
if (
|
|
4209
|
+
const otherOrientation = otherEdge.from.x === otherEdge.to.x ? "vertical" : otherEdge.from.y === otherEdge.to.y ? "horizontal" : "not-orthogonal";
|
|
4210
|
+
if (otherOrientation === "not-orthogonal") continue;
|
|
4211
|
+
if (edgeOrientation === otherOrientation)
|
|
4212
|
+
continue;
|
|
4208
4213
|
const hasIntersection = doesLineIntersectLine(
|
|
4209
4214
|
[edge.from, edge.to],
|
|
4210
4215
|
[otherEdge.from, otherEdge.to],
|
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.269",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"module": "dist/index.js",
|
|
@@ -20,6 +20,7 @@
|
|
|
20
20
|
},
|
|
21
21
|
"devDependencies": {
|
|
22
22
|
"@biomejs/biome": "^1.8.3",
|
|
23
|
+
"@tscircuit/import-snippet": "^0.0.4",
|
|
23
24
|
"@tscircuit/layout": "^0.0.28",
|
|
24
25
|
"@tscircuit/log-soup": "^1.0.2",
|
|
25
26
|
"@types/bun": "latest",
|