rm-graphical-computing-node 1.0.157 → 1.0.159

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 +22 -13
  2. package/package.json +1 -1
package/dist/index.mjs CHANGED
@@ -9197,7 +9197,7 @@ var getBeamLine = async (lines, runDataList, pcdData, lineReader, lineEditor, on
9197
9197
  let isTrue = !isDoor && !tmpDoorBeamData.isDoor && (length1 > length22 * 2.5 || length22 > length1 * 2.5);
9198
9198
  let ptClose1 = line3.closestPointToPoint(ptCenter, false, targetVector);
9199
9199
  let minDist = ptClose1.distanceTo(ptCenter);
9200
- if (minDist > 0.01 && dist2 < 0.5 && isInsert != null && !isTrue) {
9200
+ if (minDist > 0.01 && dist2 < 0.65 && isInsert != null && !isTrue) {
9201
9201
  let isSameLine = false;
9202
9202
  for (let v2 = 0; v2 < line2.doorAndBeamData.length; v2++) {
9203
9203
  if (line2.doorAndBeamData[v2].id == tmpDoorBeamData.id) {
@@ -9251,6 +9251,7 @@ var getBeamLine = async (lines, runDataList, pcdData, lineReader, lineEditor, on
9251
9251
  doorAndBeamDataObj.doorStart.z = doorAndBeamDataObj.doorEnd.z = doorZ;
9252
9252
  let beforeLengthShort = length1 < length22;
9253
9253
  length1 = farthestPoints[0].distanceTo(farthestPoints[1]);
9254
+ if (beforeLengthShort) doorAndBeamDataObj.isExtend = true;
9254
9255
  if (beforeLengthShort && length1 > length22) {
9255
9256
  vecNegate = vecNegate.negate();
9256
9257
  vec2 = vec2.negate();
@@ -14381,8 +14382,10 @@ var getMergeMeaning = (allProjectionResults, wallLines, wallVerifyType, averageP
14381
14382
  ) {
14382
14383
  let tol = array[k].type == "door frame" ? 0.5 : 0.5;
14383
14384
  let boxVecK = getObbLongSideDirection(array[k].obb);
14385
+ let obbPointsClone = getOBBPoints(cloneData.obb);
14384
14386
  let polygonK = array[k].path.map((point2) => new THREE8.Vector3(point2[0], point2[1], 0));
14385
- let polygonJ = cloneData.path.map((point2) => new THREE8.Vector3(point2[0], point2[1], 0));
14387
+ let polygonJ = [obbPointsClone[0], obbPointsClone[1], obbPointsClone[2], obbPointsClone[3]];
14388
+ polygonJ = setPointsSameZ(polygonJ, 0);
14386
14389
  let f = getPolygonIntersectionRatio(polygonK, polygonJ);
14387
14390
  if (boxVecJ.length > 0.2 && boxVecK.length > 0.2 || f > 30) {
14388
14391
  let isPPPP = isParallel(boxVecJ.direction, boxVecK.direction, tol);
@@ -14483,6 +14486,7 @@ var getMergeMeaning = (allProjectionResults, wallLines, wallVerifyType, averageP
14483
14486
  });
14484
14487
  let beforeLength = newArray.length;
14485
14488
  if (clusterResult.length > 0 && clusterResult[0].length > 1) {
14489
+ let add = 1;
14486
14490
  for (const cluster of clusterResult[0]) {
14487
14491
  if (cluster.length < 50) continue;
14488
14492
  const newOriginalPoints = cluster.map((i2) => points[i2]);
@@ -14498,7 +14502,7 @@ var getMergeMeaning = (allProjectionResults, wallLines, wallVerifyType, averageP
14498
14502
  type: type2,
14499
14503
  averagePz: averagePz3,
14500
14504
  obb: null,
14501
- obj_id,
14505
+ obj_id: obj_id + `_${add}`,
14502
14506
  positionArr,
14503
14507
  isStaircaseBalconyRailing,
14504
14508
  mapPosition: array[j]?.mapPosition
@@ -14506,6 +14510,7 @@ var getMergeMeaning = (allProjectionResults, wallLines, wallVerifyType, averageP
14506
14510
  data.obb = getObb(data.path, data.center, data.h, (data.maxz + data.minz) / 2);
14507
14511
  if (data.obb == null) continue;
14508
14512
  newArray.push(data);
14513
+ add++;
14509
14514
  }
14510
14515
  }
14511
14516
  if (newArray.length != beforeLength) {
@@ -14961,6 +14966,8 @@ var getMergeMeaning = (allProjectionResults, wallLines, wallVerifyType, averageP
14961
14966
  positionArr: array[j].positionArr,
14962
14967
  isStaircaseBalconyRailing: array[j].isStaircaseBalconyRailing,
14963
14968
  mapPosition: mapTmp
14969
+ // ,
14970
+ // contour: array[j].path
14964
14971
  });
14965
14972
  }
14966
14973
  }
@@ -17254,7 +17261,6 @@ var getWindowData = (lines, pcdData, lineReader) => {
17254
17261
  let totalArea = 0;
17255
17262
  for (const region of line2.mergeCheckRegion) {
17256
17263
  const facePoints = region.facePoints;
17257
- const boxArea = region.boxArea;
17258
17264
  const totalInPlaneNum = region.totalInPlaneNum;
17259
17265
  if (!facePoints || facePoints.length <= 0)
17260
17266
  continue;
@@ -17278,16 +17284,22 @@ var getWindowData = (lines, pcdData, lineReader) => {
17278
17284
  }
17279
17285
  }
17280
17286
  totalArea += region.area;
17281
- let cutRegionArea = 0;
17282
- if (totalInPlaneNum != 0) {
17283
- cutRegionArea = region.gridHeight * region.gridWidth * totalInPlaneNum;
17284
- }
17285
- let areaPercentage = (region.area - cutRegionArea) / boxArea * 100;
17286
- if (areaPercentage > 70 && regionData.length == 1 || regionData.length > 1) {
17287
+ if (
17288
+ /**areaPercentage > 70 && */
17289
+ regionData.length == 1 || regionData.length > 1
17290
+ ) {
17287
17291
  for (let w = 0; w < regionData.length; w++) {
17288
17292
  const tmpRegion = regionData[w];
17289
17293
  let length2 = tmpRegion.facePoints[0].distanceTo(tmpRegion.facePoints[1]);
17290
17294
  let height = tmpRegion.facePoints[0].distanceTo(tmpRegion.facePoints[3]);
17295
+ const boxArea = length2 * height;
17296
+ let cutRegionArea = 0;
17297
+ if (totalInPlaneNum != 0) {
17298
+ cutRegionArea = region.gridHeight * region.gridWidth * totalInPlaneNum;
17299
+ }
17300
+ let areaPercentage = (region.area - cutRegionArea) / boxArea * 100;
17301
+ if (areaPercentage < 50)
17302
+ continue;
17291
17303
  let lengthPercentage = length2 / line2.length * 100;
17292
17304
  if (length2 < 0.2 || height < 0.2 || region.centerPts.length < 20)
17293
17305
  continue;
@@ -17341,9 +17353,6 @@ var getWindowData = (lines, pcdData, lineReader) => {
17341
17353
  collinearAngleMax: THREE10.MathUtils.degToRad(10),
17342
17354
  distanceThreshold: 2
17343
17355
  });
17344
- if (windowDatas[n].name == "210_front_window_001") {
17345
- console.log(index, result);
17346
- }
17347
17356
  if (result && result.type == "collinear_gap") {
17348
17357
  let ptCenter = getMid(doorSt, doorEd);
17349
17358
  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));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rm-graphical-computing-node",
3
- "version": "1.0.157",
3
+ "version": "1.0.159",
4
4
  "description": "墙体/梁线/点云语义计算库(依赖 Python 与 three.js)",
5
5
  "type": "module",
6
6
  "main": "dist/index.mjs",