@tscircuit/circuit-json-util 0.0.119 → 0.0.121
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 +3 -2
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -2938,7 +2938,8 @@ import {
|
|
|
2938
2938
|
ORIENTATION,
|
|
2939
2939
|
Point,
|
|
2940
2940
|
Polygon,
|
|
2941
|
-
Segment
|
|
2941
|
+
Segment,
|
|
2942
|
+
Utils
|
|
2942
2943
|
} from "@flatten-js/core";
|
|
2943
2944
|
import { compose as compose2, rotate, translate as translate5 } from "transformation-matrix";
|
|
2944
2945
|
var placePolygon = (polygon, center, degrees = 0) => {
|
|
@@ -3100,7 +3101,7 @@ var getTraceSegmentPolygon = (start, end, startWidth, endWidth = startWidth) =>
|
|
|
3100
3101
|
const length = Math.hypot(end.x - start.x, end.y - start.y);
|
|
3101
3102
|
const r1 = startWidth / 2;
|
|
3102
3103
|
const r2 = endWidth / 2;
|
|
3103
|
-
if (length <= Math.abs(r2 - r1))
|
|
3104
|
+
if (Utils.EQ_0(length) || length <= Math.abs(r2 - r1))
|
|
3104
3105
|
return circlePolygon(r1 >= r2 ? start : end, Math.max(r1, r2));
|
|
3105
3106
|
const angle = Math.atan2(end.y - start.y, end.x - start.x);
|
|
3106
3107
|
const tangent = Math.acos((r1 - r2) / length);
|