build-dxf 0.0.20-16 → 0.0.20-17
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/package.json +1 -1
- package/src/build.js +10 -10
package/package.json
CHANGED
package/src/build.js
CHANGED
|
@@ -1376,7 +1376,7 @@ class X extends j {
|
|
|
1376
1376
|
let [a, h, l, d] = c;
|
|
1377
1377
|
const f = Math.min(h, d), m = Math.max(h, d), g = (i.width * 0.5 - 0.4 * n.scale) * (a < 0 ? -1 : 1), u = (m - f) * 0.45;
|
|
1378
1378
|
r.fillStyle = "#fff", r.font = `${0.15 * n.scale}px Arial`, r.textAlign = "center", r.textBaseline = "middle", r.fillText((m - f).toFixed(2) + "cm", g, f + (m - f) * 0.5), r.moveTo(g - 0.1 * n.scale, f), r.lineTo(g + 0.1 * n.scale, f), r.moveTo(g, f), r.lineTo(g, u + f), r.moveTo(g, m), r.lineTo(g, m - u), r.moveTo(g - 0.1 * n.scale, m), r.lineTo(g + 0.1 * n.scale, m);
|
|
1379
|
-
}), r.closePath(), r.strokeStyle = "#fff", r.stroke(),
|
|
1379
|
+
}), r.closePath(), r.strokeStyle = "#fff", r.stroke(), "toBlob" in i ? new Promise((c) => {
|
|
1380
1380
|
i.toBlob((a) => {
|
|
1381
1381
|
c(a);
|
|
1382
1382
|
}, e, 1);
|
|
@@ -1959,17 +1959,17 @@ class rt {
|
|
|
1959
1959
|
x.start === u && L.multiplyScalar(-1);
|
|
1960
1960
|
const P = o.queryCircle(u, n).filter((D) => D.userData !== x).sort((D, E) => D.point.distance(u) - E.point.distance(u)), A = [];
|
|
1961
1961
|
for (let D = 0; D < P.length; D++) {
|
|
1962
|
-
const E = e.findIndex((T) => T.point === P[D].point),
|
|
1963
|
-
if (S.has(`${
|
|
1964
|
-
S.add(`${
|
|
1962
|
+
const E = e.findIndex((T) => T.point === P[D].point), B = t[w].uuid, Y = e[E].uuid;
|
|
1963
|
+
if (S.has(`${B}.${Y}`)) continue;
|
|
1964
|
+
S.add(`${B}.${Y}`), S.add(`${Y}.${B}`);
|
|
1965
1965
|
const Q = P[D].point, C = new b(u.clone(), Q.clone());
|
|
1966
1966
|
if (C.direction().angleBetween(L, "angle") < i) {
|
|
1967
1967
|
const T = t[E].line.direction();
|
|
1968
1968
|
P[D].userData.start.equal(P[D].point) && T.multiplyScalar(-1), C.direction().multiplyScalar(-1).angleBetween(T, "angle") < i && (s.queryLineSegment(C).length || A.push({
|
|
1969
1969
|
findData: P[D],
|
|
1970
|
-
findUuid:
|
|
1970
|
+
findUuid: Y,
|
|
1971
1971
|
doorLine: C,
|
|
1972
|
-
doorUuid:
|
|
1972
|
+
doorUuid: B
|
|
1973
1973
|
}));
|
|
1974
1974
|
}
|
|
1975
1975
|
}
|
|
@@ -2019,16 +2019,16 @@ class rt {
|
|
|
2019
2019
|
const x = t.findIndex((E) => E.uuid === u.doorUuid), w = e.findIndex((E) => E.uuid === u.findUuid), S = t[x].point.clone(), L = e[w].point.clone(), P = this.findLongLineSegment(t[x].line), A = this.findLongLineSegment(e[w].line), D = P.projectPoint(L);
|
|
2020
2020
|
if (D) {
|
|
2021
2021
|
S.copy(D);
|
|
2022
|
-
const E = new b(S, L),
|
|
2023
|
-
(
|
|
2022
|
+
const E = new b(S, L), B = A.includedAngle(E);
|
|
2023
|
+
(B < 10 || B > 170 || Math.abs(90 - B) < 10) && g.push({
|
|
2024
2024
|
start: S,
|
|
2025
2025
|
end: L
|
|
2026
2026
|
});
|
|
2027
2027
|
} else {
|
|
2028
2028
|
const E = A.projectPoint(S);
|
|
2029
2029
|
E && L.copy(E);
|
|
2030
|
-
const
|
|
2031
|
-
(
|
|
2030
|
+
const B = new b(S, L), Y = P.includedAngle(B);
|
|
2031
|
+
(Y < 10 || Y > 170 || Math.abs(90 - Y) < 10) && g.push({
|
|
2032
2032
|
start: S,
|
|
2033
2033
|
end: L
|
|
2034
2034
|
});
|