rm-graphical-computing-node 1.0.158 → 1.0.160

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 +26 -17
  2. package/package.json +1 -1
package/dist/index.mjs CHANGED
@@ -8274,6 +8274,9 @@ var getBeamLine = async (lines, runDataList, pcdData, lineReader, lineEditor, on
8274
8274
  let findDoorIndexs = [];
8275
8275
  let allDoorLines1 = [];
8276
8276
  let nearDist = 0.15;
8277
+ const doorAndDoorFrameDatas = [...doorDatas];
8278
+ doorAndDoorFrameDatas.push(...doorFrame);
8279
+ doorAndDoorFrameDatas.push(...metalFraming);
8277
8280
  for (let index = 0; index < lines.length; index++) {
8278
8281
  if (onProgress != null)
8279
8282
  onProgress((index + 1) / lines.length * 60);
@@ -8685,9 +8688,6 @@ var getBeamLine = async (lines, runDataList, pcdData, lineReader, lineEditor, on
8685
8688
  length2 = beamTmpEd.distanceTo(beamTmpSt);
8686
8689
  }
8687
8690
  if (lengthPercentage < 85 && length2 > 0.3 || length2 > 0.7 && height > floorHeightTmp - floorHeightTmp / 2) {
8688
- const doorAndDoorFrameDatas = [...doorDatas];
8689
- doorAndDoorFrameDatas.push(...doorFrame);
8690
- doorAndDoorFrameDatas.push(...metalFraming);
8691
8691
  if (!line2.isLine2) {
8692
8692
  if (length2 < 2.5) {
8693
8693
  for (let n = 0; n < doorAndDoorFrameDatas.length; n++) {
@@ -8779,6 +8779,7 @@ var getBeamLine = async (lines, runDataList, pcdData, lineReader, lineEditor, on
8779
8779
  }
8780
8780
  if (doorAndDoorFrameDatas[n].category == "metal framing of interior glass partitions") {
8781
8781
  findMetalFraming = true;
8782
+ findDoorDataIndex = n;
8782
8783
  continue;
8783
8784
  }
8784
8785
  obj_id = doorAndDoorFrameDatas[n].obj_id;
@@ -8827,6 +8828,9 @@ var getBeamLine = async (lines, runDataList, pcdData, lineReader, lineEditor, on
8827
8828
  findDoorFrame = true;
8828
8829
  continue;
8829
8830
  }
8831
+ if (doorAndDoorFrameDatas[n].category == "metal framing of interior glass partitions") {
8832
+ continue;
8833
+ }
8830
8834
  let tmppLine3 = new THREE5.Line3(beamSt, beamEd);
8831
8835
  if (dist11 < nearDist || dist33 < nearDist) {
8832
8836
  doorOpenEndPoint = beamSt.clone();
@@ -8900,8 +8904,8 @@ var getBeamLine = async (lines, runDataList, pcdData, lineReader, lineEditor, on
8900
8904
  if (isOverlap) {
8901
8905
  if (findDoorDataIndex != -1) {
8902
8906
  if (!beforePcdDoorIsFindBeam) {
8903
- pcdData[doorDatas[findDoorDataIndex].index].isFindBeam = false;
8904
- doorDatas[findDoorDataIndex].isFind = false;
8907
+ pcdData[doorAndDoorFrameDatas[findDoorDataIndex].index].isFindBeam = false;
8908
+ doorAndDoorFrameDatas[findDoorDataIndex].isFind = false;
8905
8909
  }
8906
8910
  }
8907
8911
  continue;
@@ -9022,8 +9026,8 @@ var getBeamLine = async (lines, runDataList, pcdData, lineReader, lineEditor, on
9022
9026
  isOverlap = true;
9023
9027
  if (findDoorDataIndex != -1) {
9024
9028
  if (!beforePcdDoorIsFindBeam) {
9025
- pcdData[doorDatas[findDoorDataIndex].index].isFindBeam = false;
9026
- doorDatas[findDoorDataIndex].isFind = false;
9029
+ pcdData[doorAndDoorFrameDatas[findDoorDataIndex].index].isFindBeam = false;
9030
+ doorAndDoorFrameDatas[findDoorDataIndex].isFind = false;
9027
9031
  }
9028
9032
  }
9029
9033
  if (nearLineIndex != -1 && nearDoorIndex != -1) {
@@ -9069,8 +9073,8 @@ var getBeamLine = async (lines, runDataList, pcdData, lineReader, lineEditor, on
9069
9073
  if (isDoor && nearWall && !isPullOutDoor && !checkResultInWindow) {
9070
9074
  if (findDoorDataIndex != -1) {
9071
9075
  if (!beforePcdDoorIsFindBeam) {
9072
- pcdData[doorDatas[findDoorDataIndex].index].isFindBeam = false;
9073
- doorDatas[findDoorDataIndex].isFind = false;
9076
+ pcdData[doorAndDoorFrameDatas[findDoorDataIndex].index].isFindBeam = false;
9077
+ doorAndDoorFrameDatas[findDoorDataIndex].isFind = false;
9074
9078
  }
9075
9079
  }
9076
9080
  continue;
@@ -9375,7 +9379,7 @@ var getBeamLine = async (lines, runDataList, pcdData, lineReader, lineEditor, on
9375
9379
  let ptDoorSt = doorAndBeamDataObj.doorStart.clone();
9376
9380
  let ptDoorEd = doorAndBeamDataObj.doorEnd.clone();
9377
9381
  const doorLength = ptDoorSt.distanceTo(ptDoorEd);
9378
- const doorPcd = doorDatas[findDoorDataIndex];
9382
+ const doorPcd = doorAndDoorFrameDatas[findDoorDataIndex];
9379
9383
  const ptDoorPcdSt = doorPcd.doorStartPt.clone();
9380
9384
  const ptDoorPcdEd = doorPcd.doorEndPt.clone();
9381
9385
  let pcdLength = doorPcd.length;
@@ -14382,8 +14386,10 @@ var getMergeMeaning = (allProjectionResults, wallLines, wallVerifyType, averageP
14382
14386
  ) {
14383
14387
  let tol = array[k].type == "door frame" ? 0.5 : 0.5;
14384
14388
  let boxVecK = getObbLongSideDirection(array[k].obb);
14389
+ let obbPointsClone = getOBBPoints(cloneData.obb);
14385
14390
  let polygonK = array[k].path.map((point2) => new THREE8.Vector3(point2[0], point2[1], 0));
14386
- let polygonJ = cloneData.path.map((point2) => new THREE8.Vector3(point2[0], point2[1], 0));
14391
+ let polygonJ = [obbPointsClone[0], obbPointsClone[1], obbPointsClone[2], obbPointsClone[3]];
14392
+ polygonJ = setPointsSameZ(polygonJ, 0);
14387
14393
  let f = getPolygonIntersectionRatio(polygonK, polygonJ);
14388
14394
  if (boxVecJ.length > 0.2 && boxVecK.length > 0.2 || f > 30) {
14389
14395
  let isPPPP = isParallel(boxVecJ.direction, boxVecK.direction, tol);
@@ -14484,6 +14490,7 @@ var getMergeMeaning = (allProjectionResults, wallLines, wallVerifyType, averageP
14484
14490
  });
14485
14491
  let beforeLength = newArray.length;
14486
14492
  if (clusterResult.length > 0 && clusterResult[0].length > 1) {
14493
+ let add = 1;
14487
14494
  for (const cluster of clusterResult[0]) {
14488
14495
  if (cluster.length < 50) continue;
14489
14496
  const newOriginalPoints = cluster.map((i2) => points[i2]);
@@ -14499,7 +14506,7 @@ var getMergeMeaning = (allProjectionResults, wallLines, wallVerifyType, averageP
14499
14506
  type: type2,
14500
14507
  averagePz: averagePz3,
14501
14508
  obb: null,
14502
- obj_id,
14509
+ obj_id: obj_id + `_${add}`,
14503
14510
  positionArr,
14504
14511
  isStaircaseBalconyRailing,
14505
14512
  mapPosition: array[j]?.mapPosition
@@ -14507,6 +14514,7 @@ var getMergeMeaning = (allProjectionResults, wallLines, wallVerifyType, averageP
14507
14514
  data.obb = getObb(data.path, data.center, data.h, (data.maxz + data.minz) / 2);
14508
14515
  if (data.obb == null) continue;
14509
14516
  newArray.push(data);
14517
+ add++;
14510
14518
  }
14511
14519
  }
14512
14520
  if (newArray.length != beforeLength) {
@@ -14536,8 +14544,10 @@ var getMergeMeaning = (allProjectionResults, wallLines, wallVerifyType, averageP
14536
14544
  for (let k = 0; k < array.length; k++) {
14537
14545
  if (array[k].obb == null || delData.has(k) || j == k)
14538
14546
  continue;
14547
+ let obbPointsClone = getOBBPoints(arrayJ.obb);
14539
14548
  let polygonK = array[k].path.map((point2) => new THREE8.Vector3(point2[0], point2[1], 0));
14540
- let polygonJ = arrayJ.path.map((point2) => new THREE8.Vector3(point2[0], point2[1], 0));
14549
+ let polygonJ = [obbPointsClone[0], obbPointsClone[1], obbPointsClone[2], obbPointsClone[3]];
14550
+ polygonJ = setPointsSameZ(polygonJ, 0);
14541
14551
  let f = getPolygonIntersectionRatio(polygonK, polygonJ);
14542
14552
  if (f > 80) {
14543
14553
  delData.add(k);
@@ -17349,9 +17359,6 @@ var getWindowData = (lines, pcdData, lineReader) => {
17349
17359
  collinearAngleMax: THREE10.MathUtils.degToRad(10),
17350
17360
  distanceThreshold: 2
17351
17361
  });
17352
- if (windowDatas[n].name == "210_front_window_001") {
17353
- console.log(index, result);
17354
- }
17355
17362
  if (result && result.type == "collinear_gap") {
17356
17363
  let ptCenter = getMid(doorSt, doorEd);
17357
17364
  let line3 = new THREE10.Line3(new THREE10.Vector3(line2.start.x, line2.start.y, 0), new THREE10.Vector3(line2.end.x, line2.end.y, 0));
@@ -17431,7 +17438,6 @@ var getWindowData = (lines, pcdData, lineReader) => {
17431
17438
  let isPPP = getParallelism(doorStExtended, doorEdExtended, beamStExtended, beamEdExtended);
17432
17439
  if (isPPP.isParallel)
17433
17440
  continue;
17434
- windowToWallAngle = isPPP.angleDeg;
17435
17441
  let insertPt = segmentsIntersect2D(doorStExtended, doorEdExtended, beamStExtended, beamEdExtended);
17436
17442
  let bIsTrue = true;
17437
17443
  let dist11 = doorSt.distanceTo(beamSt);
@@ -17440,6 +17446,7 @@ var getWindowData = (lines, pcdData, lineReader) => {
17440
17446
  let dist44 = doorEd.distanceTo(beamEd);
17441
17447
  let isNear = dist11 < nearDist || dist22 < nearDist || dist33 < nearDist || dist44 < nearDist;
17442
17448
  if ((isNear || insertPt) && bIsTrue) {
17449
+ windowToWallAngle = isPPP.angleDeg;
17443
17450
  beforePcdDoorisFindWindow = pcdData[windowDatas[n].index].isFindWindow;
17444
17451
  pcdData[windowDatas[n].index].isFindWindow = true;
17445
17452
  isWindow = true;
@@ -18001,6 +18008,8 @@ var getWindowPcdData = (lines, pcdData) => {
18001
18008
  for (let j = 0; j < lines.length; j++) {
18002
18009
  const line3 = lines[j];
18003
18010
  if (line3.isRebuild) continue;
18011
+ if (line3.findWindowObjId && line3.findWindowObjId != pcd.obj_id)
18012
+ continue;
18004
18013
  let ptStart2 = getPt3(line3.start);
18005
18014
  let ptEnd2 = getPt3(line3.end);
18006
18015
  ptStart2.z = ptEnd2.z = ptMid1.z;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rm-graphical-computing-node",
3
- "version": "1.0.158",
3
+ "version": "1.0.160",
4
4
  "description": "墙体/梁线/点云语义计算库(依赖 Python 与 three.js)",
5
5
  "type": "module",
6
6
  "main": "dist/index.mjs",