rm-graphical-computing-node 1.0.147 → 1.0.148
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 +55 -6
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -6927,7 +6927,6 @@ var getBeamLine = async (lines, runDataList, pcdData, lineReader, lineEditor, on
|
|
|
6927
6927
|
beamTmpEd = doorTmpSt.clone();
|
|
6928
6928
|
beamTmpSt.z = beamTmpEd.z = tmpRegion.facePoints[2].z;
|
|
6929
6929
|
length2 = beamTmpSt.distanceTo(beamTmpEd);
|
|
6930
|
-
console.log(111);
|
|
6931
6930
|
}
|
|
6932
6931
|
if (length2 > 1.3) {
|
|
6933
6932
|
if (doorAndDoorFrameDatas[n].category === "door frame") {
|
|
@@ -8456,8 +8455,6 @@ var getBeamLine = async (lines, runDataList, pcdData, lineReader, lineEditor, on
|
|
|
8456
8455
|
line2.checkResults = lineReader.getLineCheckReultsById(line2.id);
|
|
8457
8456
|
for (let i = 0; i < line2.doorAndBeamData.length; i++) {
|
|
8458
8457
|
const doorAndBeamObj = line2.doorAndBeamData[i];
|
|
8459
|
-
if (doorAndBeamObj.type != "door")
|
|
8460
|
-
continue;
|
|
8461
8458
|
let ptDoorSt = doorAndBeamObj.doorStart.clone();
|
|
8462
8459
|
let ptDoorEd = doorAndBeamObj.doorEnd.clone();
|
|
8463
8460
|
if (ptStart.distanceTo(ptDoorSt) > ptStart.distanceTo(ptDoorEd))
|
|
@@ -8484,15 +8481,67 @@ var getBeamLine = async (lines, runDataList, pcdData, lineReader, lineEditor, on
|
|
|
8484
8481
|
const newDrawWindowData2 = [];
|
|
8485
8482
|
const newDrawWindowData3 = [];
|
|
8486
8483
|
if (line2.drawWindow) {
|
|
8484
|
+
let direction = getPt3(line2.direction).normalize();
|
|
8487
8485
|
for (let j = 0; j < line2.drawWindow.length; j++) {
|
|
8488
8486
|
let p = getPt3(line2.drawWindow[j].p);
|
|
8489
8487
|
p.z = line2.start.z;
|
|
8490
|
-
if (isPointOnLine2(ptStart, ptDoorSt, p, 1e-3, true))
|
|
8488
|
+
if (isPointOnLine2(ptStart, ptDoorSt, p, 1e-3, true)) {
|
|
8489
|
+
let ptW1 = p.clone().addScaledVector(direction, line2.drawWindow[j].width / 2);
|
|
8490
|
+
let ptW2 = p.clone().addScaledVector(direction, -line2.drawWindow[j].width / 2);
|
|
8491
|
+
let isOnLine1 = isPointOnLine2(ptStart, ptDoorSt, ptW1, 1e-3, true);
|
|
8492
|
+
let isOnLine2 = isPointOnLine2(ptStart, ptDoorSt, ptW2, 1e-3, true);
|
|
8493
|
+
if (!isOnLine1 && isOnLine2) {
|
|
8494
|
+
let dist1 = ptW1.distanceTo(ptStart);
|
|
8495
|
+
let dist2 = ptW1.distanceTo(ptDoorSt);
|
|
8496
|
+
let otherWindowPt = ptStart.clone();
|
|
8497
|
+
if (dist1 > dist2)
|
|
8498
|
+
otherWindowPt = ptDoorSt.clone();
|
|
8499
|
+
let dist3 = otherWindowPt.distanceTo(ptW2);
|
|
8500
|
+
let midPt = getMid(otherWindowPt, ptW2);
|
|
8501
|
+
line2.drawWindow[j].p = midPt;
|
|
8502
|
+
line2.drawWindow[j].width = dist3;
|
|
8503
|
+
} else if (isOnLine1 && !isOnLine2) {
|
|
8504
|
+
let dist1 = ptW2.distanceTo(ptStart);
|
|
8505
|
+
let dist2 = ptW2.distanceTo(ptDoorSt);
|
|
8506
|
+
let otherWindowPt = ptStart.clone();
|
|
8507
|
+
if (dist1 > dist2)
|
|
8508
|
+
otherWindowPt = ptDoorSt.clone();
|
|
8509
|
+
let dist3 = otherWindowPt.distanceTo(ptW1);
|
|
8510
|
+
let midPt = getMid(otherWindowPt, ptW1);
|
|
8511
|
+
line2.drawWindow[j].p = midPt;
|
|
8512
|
+
line2.drawWindow[j].width = dist3;
|
|
8513
|
+
}
|
|
8491
8514
|
newDrawWindowData1.push(line2.drawWindow[j]);
|
|
8492
|
-
else if (isPointOnLine2(ptDoorSt, ptDoorEd, p, 1e-3, true))
|
|
8515
|
+
} else if (isPointOnLine2(ptDoorSt, ptDoorEd, p, 1e-3, true))
|
|
8493
8516
|
newDrawWindowData2.push(line2.drawWindow[j]);
|
|
8494
|
-
else if (isPointOnLine2(ptDoorEd, ptEnd, p, 1e-3, true))
|
|
8517
|
+
else if (isPointOnLine2(ptDoorEd, ptEnd, p, 1e-3, true)) {
|
|
8518
|
+
let ptW1 = p.clone().addScaledVector(direction, line2.drawWindow[j].width / 2);
|
|
8519
|
+
let ptW2 = p.clone().addScaledVector(direction, -line2.drawWindow[j].width / 2);
|
|
8520
|
+
let isOnLine1 = isPointOnLine2(ptDoorEd, ptEnd, ptW1, 1e-3, true);
|
|
8521
|
+
let isOnLine2 = isPointOnLine2(ptDoorEd, ptEnd, ptW2, 1e-3, true);
|
|
8522
|
+
if (!isOnLine1 && isOnLine2) {
|
|
8523
|
+
let dist1 = ptW1.distanceTo(ptDoorEd);
|
|
8524
|
+
let dist2 = ptW1.distanceTo(ptEnd);
|
|
8525
|
+
let otherWindowPt = ptDoorEd.clone();
|
|
8526
|
+
if (dist1 > dist2)
|
|
8527
|
+
otherWindowPt = ptEnd.clone();
|
|
8528
|
+
let dist3 = otherWindowPt.distanceTo(ptW2);
|
|
8529
|
+
let midPt = getMid(otherWindowPt, ptW2);
|
|
8530
|
+
line2.drawWindow[j].p = midPt;
|
|
8531
|
+
line2.drawWindow[j].width = dist3;
|
|
8532
|
+
} else if (isOnLine1 && !isOnLine2) {
|
|
8533
|
+
let dist1 = ptW2.distanceTo(ptDoorEd);
|
|
8534
|
+
let dist2 = ptW2.distanceTo(ptEnd);
|
|
8535
|
+
let otherWindowPt = ptDoorEd.clone();
|
|
8536
|
+
if (dist1 > dist2)
|
|
8537
|
+
otherWindowPt = ptEnd.clone();
|
|
8538
|
+
let dist3 = otherWindowPt.distanceTo(ptW1);
|
|
8539
|
+
let midPt = getMid(otherWindowPt, ptW1);
|
|
8540
|
+
line2.drawWindow[j].p = midPt;
|
|
8541
|
+
line2.drawWindow[j].width = dist3;
|
|
8542
|
+
}
|
|
8495
8543
|
newDrawWindowData3.push(line2.drawWindow[j]);
|
|
8544
|
+
}
|
|
8496
8545
|
}
|
|
8497
8546
|
}
|
|
8498
8547
|
const newCheckResults1 = [];
|