@tscircuit/core 0.0.260 → 0.0.261

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.
Files changed (2) hide show
  1. package/dist/index.js +13 -9
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -4178,14 +4178,9 @@ var getOtherSchematicTraces = ({
4178
4178
  import { getUnitVectorFromPointAToB } from "@tscircuit/math-utils";
4179
4179
  var createSchematicTraceCrossingSegments = ({
4180
4180
  edges,
4181
- db,
4182
- source_trace_id
4181
+ otherEdges
4183
4182
  }) => {
4184
- const otherEdges = getOtherSchematicTraces({
4185
- db,
4186
- source_trace_id,
4187
- differentNetOnly: true
4188
- }).flatMap((t) => t.edges);
4183
+ edges = [...edges];
4189
4184
  for (let i = 0; i < edges.length; i++) {
4190
4185
  if (i > 2e3) {
4191
4186
  throw new Error(
@@ -4223,6 +4218,9 @@ var createSchematicTraceCrossingSegments = ({
4223
4218
  }
4224
4219
  const crossingPoint = closestIntersection.crossingPoint;
4225
4220
  const crossingSegmentLength = 0.075;
4221
+ if (crossingPoint.x === edge.from.x && crossingPoint.y === edge.from.y) {
4222
+ continue;
4223
+ }
4226
4224
  const crossingUnitVec = getUnitVectorFromPointAToB(edge.from, crossingPoint);
4227
4225
  const beforeCrossing = {
4228
4226
  x: crossingPoint.x - crossingUnitVec.x * crossingSegmentLength / 2,
@@ -4244,6 +4242,7 @@ var createSchematicTraceCrossingSegments = ({
4244
4242
  i++;
4245
4243
  }
4246
4244
  }
4245
+ return edges;
4247
4246
  };
4248
4247
 
4249
4248
  // lib/components/primitive-components/Trace/create-schematic-trace-junctions.ts
@@ -5197,7 +5196,7 @@ searched component ${targetComponent.getString()}, which has ports: ${targetComp
5197
5196
  skipOtherTraceInteraction = true;
5198
5197
  }
5199
5198
  const [{ route }] = results;
5200
- const edges = [];
5199
+ let edges = [];
5201
5200
  for (let i = 0; i < route.length - 1; i++) {
5202
5201
  edges.push({
5203
5202
  from: route[i],
@@ -5208,7 +5207,12 @@ searched component ${targetComponent.getString()}, which has ports: ${targetComp
5208
5207
  let junctions = [];
5209
5208
  if (!skipOtherTraceInteraction) {
5210
5209
  pushEdgesOfSchematicTraceToPreventOverlap({ edges, db, source_trace_id });
5211
- createSchematicTraceCrossingSegments({ edges, db, source_trace_id });
5210
+ const otherEdges = getOtherSchematicTraces({
5211
+ db,
5212
+ source_trace_id,
5213
+ differentNetOnly: true
5214
+ }).flatMap((t) => t.edges);
5215
+ edges = createSchematicTraceCrossingSegments({ edges, otherEdges });
5212
5216
  junctions = createSchematicTraceJunctions({
5213
5217
  edges,
5214
5218
  db,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@tscircuit/core",
3
3
  "type": "module",
4
- "version": "0.0.260",
4
+ "version": "0.0.261",
5
5
  "types": "dist/index.d.ts",
6
6
  "main": "dist/index.js",
7
7
  "module": "dist/index.js",