rm-graphical-computing-node 1.0.126 → 1.0.128

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 +49 -25
  2. package/package.json +1 -1
package/dist/index.mjs CHANGED
@@ -1659,14 +1659,15 @@ var getLimitLine = (line2, retType) => {
1659
1659
  };
1660
1660
  }
1661
1661
  };
1662
- var getLineCheckResultsFloat32 = async (finalLines, limit2 = true, retType = "three") => {
1662
+ var getLineCheckResultsFloat32 = async (finalLines, limit = true, retType = "three") => {
1663
1663
  for (let i = 0; i < finalLines.length; i++) {
1664
1664
  const line2 = finalLines[i];
1665
- await getOneLineCheckResultsFloat32(line2, limit2, retType);
1665
+ await getOneLineCheckResultsFloat32(line2, limit, retType);
1666
1666
  }
1667
1667
  };
1668
- var getOneLineCheckResultsFloat32 = (line2, limit2 = true, retType = "three") => {
1669
- if ((line2.isBayWindow || line2.isWindow || line2.isBalconyRailing) && limit2) {
1668
+ var getOneLineCheckResultsFloat32 = (line2, limit = true, retType = "three") => {
1669
+ if ((line2.isBayWindow || line2.isWindow && line2.groupId || line2.isBalconyRailing) && limit) {
1670
+ line2.checkResults = [];
1670
1671
  return;
1671
1672
  }
1672
1673
  const plane = new Plane().setFromCoplanarPoints(
@@ -2400,26 +2401,27 @@ var getLimitLine2 = (line2, retType) => {
2400
2401
  };
2401
2402
  }
2402
2403
  };
2403
- var getOneLineCheckResults = (line2, limit2 = true, retType = "three", inputType = "xyz") => {
2404
+ var getOneLineCheckResults = (line2, limit = true, retType = "three", inputType = "xyz") => {
2404
2405
  if (inputType == "xyz")
2405
- getOneLineCheckResultsMain(line2, limit2, retType);
2406
+ getOneLineCheckResultsMain(line2, limit, retType);
2406
2407
  else if (inputType == "array")
2407
- getOneLineCheckResultsFloat32(line2, limit2, retType);
2408
+ getOneLineCheckResultsFloat32(line2, limit, retType);
2408
2409
  };
2409
- var getLineCheckResults = (finalLines, limit2 = true, retType = "three", inputType = "xyz") => {
2410
+ var getLineCheckResults = (finalLines, limit = true, retType = "three", inputType = "xyz") => {
2410
2411
  if (inputType == "xyz")
2411
- getLineCheckResultsMain(finalLines, limit2, retType);
2412
+ getLineCheckResultsMain(finalLines, limit, retType);
2412
2413
  else if (inputType == "array")
2413
- getLineCheckResultsFloat32(finalLines, limit2, retType);
2414
+ getLineCheckResultsFloat32(finalLines, limit, retType);
2414
2415
  };
2415
- var getLineCheckResultsMain = (finalLines, limit2 = true, retType = "three") => {
2416
+ var getLineCheckResultsMain = (finalLines, limit = true, retType = "three") => {
2416
2417
  for (let i = 0; i < finalLines.length; i++) {
2417
2418
  const line2 = finalLines[i];
2418
- getOneLineCheckResultsMain(line2, limit2, retType);
2419
+ getOneLineCheckResultsMain(line2, limit, retType);
2419
2420
  }
2420
2421
  };
2421
- var getOneLineCheckResultsMain = (line2, limit2 = true, retType = "three") => {
2422
- if ((line2.isBayWindow || line2.isWindow || line2.isBalconyRailing) && limit2) {
2422
+ var getOneLineCheckResultsMain = (line2, limit = true, retType = "three") => {
2423
+ if ((line2.isBayWindow || line2.isWindow && line2.groupId || line2.isBalconyRailing) && limit) {
2424
+ line2.checkResults = [];
2423
2425
  return;
2424
2426
  }
2425
2427
  const plane = new Plane2().setFromCoplanarPoints(
@@ -2485,8 +2487,9 @@ var getOneLineCheckResultsMain = (line2, limit2 = true, retType = "three") => {
2485
2487
  line2.existSegments = existSegments;
2486
2488
  }
2487
2489
  };
2488
- var getOneLineClusterResults = (line2) => {
2489
- if ((line2.isBayWindow || line2.isWindow || line2.isBalconyRailing) && limit) {
2490
+ var getOneLineClusterResults = (line2, limit) => {
2491
+ if ((line2.isBayWindow || line2.isWindow && line2.groupId || line2.isBalconyRailing) && limit) {
2492
+ line2.checkResults = [];
2490
2493
  return;
2491
2494
  }
2492
2495
  const plane = new Plane2().setFromCoplanarPoints(
@@ -8441,8 +8444,8 @@ function computeContour(points) {
8441
8444
  if (cross3 === 0) continue;
8442
8445
  const cross22 = cross3 * cross3;
8443
8446
  const xZero = ax === 0 || bx === 0 || cx === 0;
8444
- const limit2 = xZero ? cross22 : 4 * cross22;
8445
- if (a2 * b2 * c2 <= limit2) {
8447
+ const limit = xZero ? cross22 : 4 * cross22;
8448
+ if (a2 * b2 * c2 <= limit) {
8446
8449
  addEdge(edgeCount, n, ia, ib);
8447
8450
  addEdge(edgeCount, n, ib, ic);
8448
8451
  addEdge(edgeCount, n, ic, ia);
@@ -9762,12 +9765,24 @@ var getMergeMeaning = (allProjectionResults, wallLines, wallVerifyType, averageP
9762
9765
  for (let i = 0; i < sourceData.array.length; i++) {
9763
9766
  const sourceItem = sourceData.array[i];
9764
9767
  if (sourceItem.obb == null) continue;
9768
+ let boxVecK = getObbLongSideDirection(sourceItem.obb);
9765
9769
  for (let j = 0; j < targetData.array.length; j++) {
9766
9770
  const targetItem = targetData.array[j];
9767
9771
  if (targetItem.obb == null) continue;
9768
9772
  if (targetType == "window" && sourceType == "balcony railing" && !targetItem.isHasTie) {
9769
9773
  continue;
9770
9774
  }
9775
+ if (targetType == "window" && sourceType == "metal framing of interior glass partitions") {
9776
+ let tol = 0.5;
9777
+ let f = calculateClosePointWithOBB(sourceItem.points, targetItem.obb);
9778
+ let boxVecJ = getObbLongSideDirection(targetItem.obb);
9779
+ if (boxVecJ.length() > 0.3 && boxVecK.length() > 0.3 || f > 0.3) {
9780
+ let isPPPP = isParallel(boxVecJ, boxVecK, tol);
9781
+ if (!isPPPP || !isPPPP.parallel) {
9782
+ continue;
9783
+ }
9784
+ }
9785
+ }
9771
9786
  let isMerge = sourceItem.obb.intersectsOBB(targetItem.obb, 0.01);
9772
9787
  if (!isMerge)
9773
9788
  isMerge = obbContainsOBB(sourceItem.obb, targetItem.obb);
@@ -9854,7 +9869,7 @@ var getMergeMeaning = (allProjectionResults, wallLines, wallVerifyType, averageP
9854
9869
  let tol = array[k].type == "door frame" ? 0.5 : 0.5;
9855
9870
  let boxVecK = getObbLongSideDirection(array[k].obb);
9856
9871
  let f = calculateClosePointWithOBB(array[k].points, cloneData.obb);
9857
- if (boxVecJ.length() > 0.3 && boxVecK.length() > 0.3 && f < 0.3) {
9872
+ if (boxVecJ.length() > 0.3 && boxVecK.length() > 0.3 || f > 0.3) {
9858
9873
  let isPPPP = isParallel(boxVecJ, boxVecK, tol);
9859
9874
  if (!isPPPP || !isPPPP.parallel) {
9860
9875
  continue;
@@ -10265,8 +10280,8 @@ var getMergeMeaning = (allProjectionResults, wallLines, wallVerifyType, averageP
10265
10280
  for (let j = 0; j < array.length; j++) {
10266
10281
  let maxPz = array[j].maxz;
10267
10282
  let minPz = array[j].minz;
10268
- let limit2 = type === "switch" ? 0.1 : 0.3;
10269
- if (Math.abs(maxPz - averagePz2) < limit2 && type != "floor") {
10283
+ let limit = type === "switch" ? 0.1 : 0.3;
10284
+ if (Math.abs(maxPz - averagePz2) < limit && type != "floor") {
10270
10285
  array[j].isDel = true;
10271
10286
  continue;
10272
10287
  }
@@ -14769,8 +14784,11 @@ var getWindowData = (lines, pcdData, lineReader) => {
14769
14784
  for (let line2 of lines) {
14770
14785
  let allRegion = [];
14771
14786
  line2.checkResults = lineReader.getLineCheckReultsById(line2.id);
14772
- if (!line2.checkResults || line2.checkResults.length <= 0)
14787
+ if (!line2.checkResults || line2.checkResults.length <= 0) {
14788
+ if (line2.mergeCheckRegion)
14789
+ line2.mergeCheckRegion = [];
14773
14790
  continue;
14791
+ }
14774
14792
  for (let r = 0; r < line2.checkResults.length; r++) {
14775
14793
  let find = function(i) {
14776
14794
  while (parent[i] !== i) {
@@ -15066,7 +15084,7 @@ var getWindowData = (lines, pcdData, lineReader) => {
15066
15084
  }
15067
15085
  }
15068
15086
  }
15069
- if (length2 < 1.5) {
15087
+ if (length2 < 1.5 && findDoorDataIndex !== -1) {
15070
15088
  for (let n = 0; n < windowDatas.length; n++) {
15071
15089
  if (windowDatas[n].inWall || windowDatas[n].isFind) continue;
15072
15090
  let doorSt = new THREE10.Vector3(windowDatas[n].windowStartPt.x, windowDatas[n].windowStartPt.y, 0);
@@ -15346,11 +15364,17 @@ var getWindowData = (lines, pcdData, lineReader) => {
15346
15364
  inRectNum++;
15347
15365
  }
15348
15366
  let inRectPercentage = inRectNum / checkResultsNum;
15349
- if (inRectPercentage < 0.8)
15367
+ if (inRectPercentage < 0.8) {
15368
+ pcdData[windowDatas[findDoorDataIndex].index].isFindWindow = false;
15369
+ windowDatas[findDoorDataIndex].isFind = false;
15350
15370
  continue;
15371
+ }
15351
15372
  }
15352
- if (windowPcd.maxZ < doorAndBeamDataObj.windowBottomSt.z || Math.abs(windowPcd.maxZ - doorAndBeamDataObj.windowBottomSt.z) < 0.3)
15373
+ if (windowPcd.maxZ < doorAndBeamDataObj.windowBottomSt.z || Math.abs(windowPcd.maxZ - doorAndBeamDataObj.windowBottomSt.z) < 0.3) {
15374
+ pcdData[windowDatas[findDoorDataIndex].index].isFindWindow = false;
15375
+ windowDatas[findDoorDataIndex].isFind = false;
15353
15376
  continue;
15377
+ }
15354
15378
  line2.windowIdToCheckResults.push([region.index, id]);
15355
15379
  if (windowDatas[findDoorDataIndex].findLineIndex.length > 0) {
15356
15380
  let lineIndex = windowDatas[findDoorDataIndex].findLineIndex[0];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rm-graphical-computing-node",
3
- "version": "1.0.126",
3
+ "version": "1.0.128",
4
4
  "description": "墙体/梁线/点云语义计算库(依赖 Python 与 three.js)",
5
5
  "type": "module",
6
6
  "main": "dist/index.mjs",