@tscircuit/capacity-autorouter 0.0.46 → 0.0.48

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
@@ -2038,7 +2038,7 @@ function clamp(value, min, max) {
2038
2038
  return Math.max(min, Math.min(max, value));
2039
2039
  }
2040
2040
 
2041
- // node_modules/@tscircuit/math-utils/dist/chunk-OMVVSGKD.js
2041
+ // node_modules/@tscircuit/math-utils/dist/chunk-K7F26NYD.js
2042
2042
  function segmentToBoundsMinDistance(a, b, bounds) {
2043
2043
  const topLeft = { x: bounds.minX, y: bounds.minY };
2044
2044
  const topRight = { x: bounds.maxX, y: bounds.minY };
@@ -8144,10 +8144,11 @@ var SingleSimplifiedPathSolver5 = class extends SingleSimplifiedPathSolver {
8144
8144
  const vias = hdRoute.vias;
8145
8145
  const filteredVias = [];
8146
8146
  for (const via of vias) {
8147
- const minX = via.x - hdRoute.viaDiameter / 2;
8148
- const maxX = via.x + hdRoute.viaDiameter / 2;
8149
- const minY = via.y - hdRoute.viaDiameter / 2;
8150
- const maxY = via.y + hdRoute.viaDiameter / 2;
8147
+ const margin = this.OBSTACLE_MARGIN + this.TRACE_THICKNESS / 2 + hdRoute.viaDiameter / 2;
8148
+ const minX = via.x - margin;
8149
+ const maxX = via.x + margin;
8150
+ const minY = via.y - margin;
8151
+ const maxY = via.y + margin;
8151
8152
  if (minX <= bounds.maxX && maxX >= bounds.minX && minY <= bounds.maxY && maxY >= bounds.minY) {
8152
8153
  filteredVias.push({ ...via, diameter: hdRoute.viaDiameter });
8153
8154
  }
@@ -8386,8 +8387,17 @@ var SingleSimplifiedPathSolver5 = class extends SingleSimplifiedPathSolver {
8386
8387
  return;
8387
8388
  }
8388
8389
  if (!path45 && !this.lastValidPath) {
8390
+ const oldTailPoint = this.getPointAtDistance(this.tailDistanceAlongPath);
8389
8391
  this.tailDistanceAlongPath += this.minStepSize;
8390
8392
  this.moveHead(this.minStepSize);
8393
+ const newTailIndex = this.getNearestIndexForDistance(
8394
+ this.tailDistanceAlongPath
8395
+ );
8396
+ const newTailPoint = this.inputRoute.route[newTailIndex];
8397
+ const lastRoutePoint = this.inputRoute.route[this.inputRoute.route.length - 1];
8398
+ if (!this.arePointsEqual(oldTailPoint, newTailPoint) && !this.arePointsEqual(newTailPoint, lastRoutePoint)) {
8399
+ this.newRoute.push(newTailPoint);
8400
+ }
8391
8401
  return;
8392
8402
  }
8393
8403
  if (path45) {