@tscircuit/schematic-trace-solver 0.0.104 → 0.0.105

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 CHANGED
@@ -4790,7 +4790,7 @@ var minimizeTurnsWithFilteredLabels = ({
4790
4790
  throw new Error(`Target trace ${targetMspConnectionPairId} not found`);
4791
4791
  }
4792
4792
  const obstacleTraces = traces.filter(
4793
- (t) => t.mspPairId !== targetMspConnectionPairId
4793
+ (t) => t.mspPairId !== targetMspConnectionPairId && t.globalConnNetId !== targetTrace.globalConnNetId
4794
4794
  );
4795
4795
  const TRACE_WIDTH = 0.01;
4796
4796
  const traceObstacles = obstacleTraces.flatMap(
@@ -5,8 +5,8 @@ import { getObstacleRects } from "lib/solvers/SchematicTraceLinesSolver/Schemati
5
5
  import type { NetLabelPlacement } from "../NetLabelPlacementSolver/NetLabelPlacementSolver"
6
6
 
7
7
  /**
8
- * Minimizes the turns of a target trace while considering other traces and labels as obstacles.
9
- * This function first identifies the target trace and separates it from other traces, which are then treated as obstacles.
8
+ * Minimizes the turns of a target trace while considering different-net traces and labels as obstacles.
9
+ * This function first identifies the target trace and separates traces from other nets, which are then treated as obstacles.
10
10
  * It also filters out labels that belong to the target trace's net, so they don't act as obstacles.
11
11
  * The function then combines static obstacles (from the input problem) with the other traces and filtered labels to create a comprehensive set of obstacles.
12
12
  * Finally, it uses a turn minimization algorithm to find a new path for the target trace that avoids these combined obstacles.
@@ -33,8 +33,12 @@ export const minimizeTurnsWithFilteredLabels = ({
33
33
  throw new Error(`Target trace ${targetMspConnectionPairId} not found`)
34
34
  }
35
35
 
36
+ // Same-net traces are valid connection targets: letting the candidate path
37
+ // coincide with them removes unnecessary detours and forms clean junctions.
36
38
  const obstacleTraces = traces.filter(
37
- (t) => t.mspPairId !== targetMspConnectionPairId,
39
+ (t) =>
40
+ t.mspPairId !== targetMspConnectionPairId &&
41
+ t.globalConnNetId !== targetTrace.globalConnNetId,
38
42
  )
39
43
 
40
44
  const TRACE_WIDTH = 0.01
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@tscircuit/schematic-trace-solver",
3
3
  "main": "dist/index.js",
4
- "version": "0.0.104",
4
+ "version": "0.0.105",
5
5
  "type": "module",
6
6
  "scripts": {
7
7
  "start": "cosmos",
@@ -0,0 +1,4 @@
1
+ import { PipelineDebugger } from "site/components/PipelineDebugger"
2
+ import inputProblem from "../../tests/bug-reports/bug-report-20260721T221026Z/bug-report-20260721T221026Z.json"
3
+
4
+ export default () => <PipelineDebugger inputProblem={inputProblem as any} />