build-dxf 0.1.86 → 0.1.87

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/package.json +1 -1
  2. package/src/build.js +3 -3
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "build-dxf",
3
- "version": "0.1.86",
3
+ "version": "0.1.87",
4
4
  "description": "线段构建双线墙壁的dxf版本",
5
5
  "main": "./src/index.js",
6
6
  "types": "./src/index.d.ts",
package/src/build.js CHANGED
@@ -2594,7 +2594,7 @@ class Point {
2594
2594
  }
2595
2595
  return num;
2596
2596
  }
2597
- hashCode(fixed = 6) {
2597
+ hashCode(fixed = 4) {
2598
2598
  return `${this.x.toFixed(fixed)},${this.y.toFixed(6)}`;
2599
2599
  }
2600
2600
  /**
@@ -7911,11 +7911,11 @@ class CAD {
7911
7911
  function drawRulerLine(p1, p2) {
7912
7912
  line.set(p1, p2);
7913
7913
  const length = line.length();
7914
- const angle = line.direction().angleBetween(new Point(0, 1), "angle");
7914
+ const angle = line.direction().angle(new Point(0, 1), { unit: "degree", range: "180" });
7915
7915
  const p1C = p1.clone();
7916
7916
  const p2C = p2.clone();
7917
7917
  const offset = expansionWidth * 0.4;
7918
- if (line.isParallelTo(angle, 35)) {
7918
+ if (Math.min(angle, 180 - angle) < 1) {
7919
7919
  if (p1.x < center.x) {
7920
7920
  p1C.x = box.minX + offset;
7921
7921
  p2C.x = box.minX + offset;