rm-graphical-computing-node 1.0.147 → 1.0.149

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/dist/index.mjs +58 -7
  2. 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") {
@@ -7046,7 +7045,7 @@ var getBeamLine = async (lines, runDataList, pcdData, lineReader, lineEditor, on
7046
7045
  let isOverlap = false;
7047
7046
  for (let m = 0; m < allDoorLines1.length; m++) {
7048
7047
  let result = classifySegments(allDoorLines1[m].start, allDoorLines1[m].end, doorTmpSt, doorTmpEd);
7049
- if (result && result.type == "collinear_overlap" && result.maxPerpendicularDistance < 0.06) {
7048
+ if (result && result.type == "collinear_overlap" && result.maxPerpendicularDistance < 0.065) {
7050
7049
  isOverlap = true;
7051
7050
  }
7052
7051
  }
@@ -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 = [];
@@ -8553,6 +8602,7 @@ var getBeamLine = async (lines, runDataList, pcdData, lineReader, lineEditor, on
8553
8602
  direction: line2.direction,
8554
8603
  drawWindow: newDrawWindowData1,
8555
8604
  isWindow: newDrawWindowData1.length > 0,
8605
+ isHoleWindow: newDrawWindowData1.length > 0,
8556
8606
  doorAndBeamIdToCheckResults: newDoorAndBeamIdToCheckResults1,
8557
8607
  checkResults: newCheckResults1
8558
8608
  };
@@ -8583,6 +8633,7 @@ var getBeamLine = async (lines, runDataList, pcdData, lineReader, lineEditor, on
8583
8633
  direction: line2.direction,
8584
8634
  drawWindow: newDrawWindowData3,
8585
8635
  isWindow: newDrawWindowData3.length > 0,
8636
+ isHoleWindow: newDrawWindowData3.length > 0,
8586
8637
  doorAndBeamIdToCheckResults: newDoorAndBeamIdToCheckResults3,
8587
8638
  checkResults: newCheckResults3
8588
8639
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rm-graphical-computing-node",
3
- "version": "1.0.147",
3
+ "version": "1.0.149",
4
4
  "description": "墙体/梁线/点云语义计算库(依赖 Python 与 three.js)",
5
5
  "type": "module",
6
6
  "main": "dist/index.mjs",