rm-graphical-computing-node 1.0.127 → 1.0.129

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 +56 -26
  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);
@@ -9849,14 +9864,14 @@ var getMergeMeaning = (allProjectionResults, wallLines, wallVerifyType, averageP
9849
9864
  }
9850
9865
  if (
9851
9866
  /**array[k].type == 'door frame' || */
9852
- array[k].type == "window"
9867
+ array[k].type == "window" || array[k].type == "metal framing of interior glass partitions"
9853
9868
  ) {
9854
9869
  let tol = array[k].type == "door frame" ? 0.5 : 0.5;
9855
9870
  let boxVecK = getObbLongSideDirection(array[k].obb);
9856
- let f = calculateClosePointWithOBB(array[k].points, cloneData.obb);
9857
- if (boxVecJ.length() > 0.3 && boxVecK.length() > 0.3 && f < 0.3) {
9871
+ let f = calculateClosePointWithOBB(array[k].points, cloneData.obb, 1);
9872
+ if (boxVecJ.length() > 0.3 && boxVecK.length() > 0.3 || f > 0.3) {
9858
9873
  let isPPPP = isParallel(boxVecJ, boxVecK, tol);
9859
- if (!isPPPP || !isPPPP.parallel) {
9874
+ if ((!isPPPP || !isPPPP.parallel) && f < 0.8) {
9860
9875
  continue;
9861
9876
  }
9862
9877
  }
@@ -9869,6 +9884,10 @@ var getMergeMeaning = (allProjectionResults, wallLines, wallVerifyType, averageP
9869
9884
  isMerge = cloneData.obb.intersectsOBB(array[k].obb, 0.01);
9870
9885
  if (!isMerge)
9871
9886
  isMerge = obbContainsOBB(cloneData.obb, array[k].obb);
9887
+ if (!isMerge) {
9888
+ let f = calculateClosePointWithOBB(array[k].points, cloneData.obb, 1);
9889
+ isMerge = f > 0.8;
9890
+ }
9872
9891
  }
9873
9892
  if (isMerge) {
9874
9893
  delData.add(k);
@@ -10265,8 +10284,8 @@ var getMergeMeaning = (allProjectionResults, wallLines, wallVerifyType, averageP
10265
10284
  for (let j = 0; j < array.length; j++) {
10266
10285
  let maxPz = array[j].maxz;
10267
10286
  let minPz = array[j].minz;
10268
- let limit2 = type === "switch" ? 0.1 : 0.3;
10269
- if (Math.abs(maxPz - averagePz2) < limit2 && type != "floor") {
10287
+ let limit = type === "switch" ? 0.1 : 0.3;
10288
+ if (Math.abs(maxPz - averagePz2) < limit && type != "floor") {
10270
10289
  array[j].isDel = true;
10271
10290
  continue;
10272
10291
  }
@@ -10325,6 +10344,14 @@ var getMergeMeaning = (allProjectionResults, wallLines, wallVerifyType, averageP
10325
10344
  array[j].isDel = true;
10326
10345
  }
10327
10346
  }
10347
+ if (type == "metal framing of interior glass partitions") {
10348
+ const size = new THREE8.Vector3();
10349
+ array[j].obb.getSize(size);
10350
+ let volume = size.x * size.y * size.z;
10351
+ if (size.x < 0.1 || size.y < 0.1 || size.z < 0.1 || volume < 0.1) {
10352
+ array[j].isDel = true;
10353
+ }
10354
+ }
10328
10355
  }
10329
10356
  }
10330
10357
  for (let i = 0; i < pcdPointsArr.length; i++) {
@@ -14769,8 +14796,11 @@ var getWindowData = (lines, pcdData, lineReader) => {
14769
14796
  for (let line2 of lines) {
14770
14797
  let allRegion = [];
14771
14798
  line2.checkResults = lineReader.getLineCheckReultsById(line2.id);
14772
- if (!line2.checkResults || line2.checkResults.length <= 0)
14799
+ if (!line2.checkResults || line2.checkResults.length <= 0) {
14800
+ if (line2.mergeCheckRegion)
14801
+ line2.mergeCheckRegion = [];
14773
14802
  continue;
14803
+ }
14774
14804
  for (let r = 0; r < line2.checkResults.length; r++) {
14775
14805
  let find = function(i) {
14776
14806
  while (parent[i] !== i) {
@@ -15066,7 +15096,7 @@ var getWindowData = (lines, pcdData, lineReader) => {
15066
15096
  }
15067
15097
  }
15068
15098
  }
15069
- if (length2 < 1.5) {
15099
+ if (length2 < 1.5 && findDoorDataIndex !== -1) {
15070
15100
  for (let n = 0; n < windowDatas.length; n++) {
15071
15101
  if (windowDatas[n].inWall || windowDatas[n].isFind) continue;
15072
15102
  let doorSt = new THREE10.Vector3(windowDatas[n].windowStartPt.x, windowDatas[n].windowStartPt.y, 0);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rm-graphical-computing-node",
3
- "version": "1.0.127",
3
+ "version": "1.0.129",
4
4
  "description": "墙体/梁线/点云语义计算库(依赖 Python 与 three.js)",
5
5
  "type": "module",
6
6
  "main": "dist/index.mjs",