rm-graphical-computing-node 1.0.131 → 1.0.132
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.mjs +15 -8
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -3529,11 +3529,17 @@ var setPointsSameZ = (points, z) => {
|
|
|
3529
3529
|
points[i].z = z;
|
|
3530
3530
|
return points;
|
|
3531
3531
|
};
|
|
3532
|
-
function getObbLongSideDirection(obb
|
|
3532
|
+
function getObbLongSideDirection(obb) {
|
|
3533
3533
|
const e = obb.rotation.elements;
|
|
3534
3534
|
const h = obb.halfSize;
|
|
3535
|
-
const
|
|
3536
|
-
|
|
3535
|
+
const isXLong = h.x >= h.y;
|
|
3536
|
+
const direction = isXLong ? new THREE3.Vector3(e[0], e[1], e[2]) : new THREE3.Vector3(e[3], e[4], e[5]);
|
|
3537
|
+
return {
|
|
3538
|
+
direction: direction.normalize(),
|
|
3539
|
+
// 长边单位方向向量
|
|
3540
|
+
length: Math.max(h.x, h.y) * 2
|
|
3541
|
+
// 长边实际长度
|
|
3542
|
+
};
|
|
3537
3543
|
}
|
|
3538
3544
|
var getPt3 = (pt) => {
|
|
3539
3545
|
return new THREE3.Vector3(pt.x, pt.y, pt.z);
|
|
@@ -9776,8 +9782,8 @@ var getMergeMeaning = (allProjectionResults, wallLines, wallVerifyType, averageP
|
|
|
9776
9782
|
let tol = 0.5;
|
|
9777
9783
|
let f = calculateClosePointWithOBB(sourceItem.points, targetItem.obb);
|
|
9778
9784
|
let boxVecJ = getObbLongSideDirection(targetItem.obb);
|
|
9779
|
-
if (boxVecJ.length
|
|
9780
|
-
let isPPPP = isParallel(boxVecJ, boxVecK, tol);
|
|
9785
|
+
if (boxVecJ.length > 0.3 && boxVecK.length > 0.3 || f > 0.3) {
|
|
9786
|
+
let isPPPP = isParallel(boxVecJ.direction, boxVecK.direction, tol);
|
|
9781
9787
|
if (!isPPPP || !isPPPP.parallel) {
|
|
9782
9788
|
continue;
|
|
9783
9789
|
}
|
|
@@ -9869,9 +9875,9 @@ var getMergeMeaning = (allProjectionResults, wallLines, wallVerifyType, averageP
|
|
|
9869
9875
|
let tol = array[k].type == "door frame" ? 0.5 : 0.5;
|
|
9870
9876
|
let boxVecK = getObbLongSideDirection(array[k].obb);
|
|
9871
9877
|
let f = calculateClosePointWithOBB(array[k].points, cloneData.obb, 1);
|
|
9872
|
-
if (boxVecJ.length
|
|
9873
|
-
let isPPPP = isParallel(boxVecJ, boxVecK, tol);
|
|
9874
|
-
if ((!isPPPP || !isPPPP.parallel) && f < 0.
|
|
9878
|
+
if (boxVecJ.length > 0.3 && boxVecK.length > 0.3 || f > 0.3) {
|
|
9879
|
+
let isPPPP = isParallel(boxVecJ.direction, boxVecK.direction, tol);
|
|
9880
|
+
if ((!isPPPP || !isPPPP.parallel) && f < 0.65) {
|
|
9875
9881
|
continue;
|
|
9876
9882
|
}
|
|
9877
9883
|
}
|
|
@@ -9918,6 +9924,7 @@ var getMergeMeaning = (allProjectionResults, wallLines, wallVerifyType, averageP
|
|
|
9918
9924
|
if (newObb != null)
|
|
9919
9925
|
cloneData.obb = newObb;
|
|
9920
9926
|
cloneData.positionArr.push(...array[k].positionArr);
|
|
9927
|
+
boxVecJ = getObbLongSideDirection(cloneData.obb);
|
|
9921
9928
|
k = j;
|
|
9922
9929
|
}
|
|
9923
9930
|
}
|