rm-graphical-computing-node 1.0.148 → 1.0.150

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 +25 -21
  2. package/package.json +1 -1
package/dist/index.mjs CHANGED
@@ -7045,7 +7045,7 @@ var getBeamLine = async (lines, runDataList, pcdData, lineReader, lineEditor, on
7045
7045
  let isOverlap = false;
7046
7046
  for (let m = 0; m < allDoorLines1.length; m++) {
7047
7047
  let result = classifySegments(allDoorLines1[m].start, allDoorLines1[m].end, doorTmpSt, doorTmpEd);
7048
- if (result && result.type == "collinear_overlap" && result.maxPerpendicularDistance < 0.06) {
7048
+ if (result && result.type == "collinear_overlap" && result.maxPerpendicularDistance < 0.065) {
7049
7049
  isOverlap = true;
7050
7050
  }
7051
7051
  }
@@ -8602,6 +8602,7 @@ var getBeamLine = async (lines, runDataList, pcdData, lineReader, lineEditor, on
8602
8602
  direction: line2.direction,
8603
8603
  drawWindow: newDrawWindowData1,
8604
8604
  isWindow: newDrawWindowData1.length > 0,
8605
+ isHoleWindow: newDrawWindowData1.length > 0,
8605
8606
  doorAndBeamIdToCheckResults: newDoorAndBeamIdToCheckResults1,
8606
8607
  checkResults: newCheckResults1
8607
8608
  };
@@ -8632,6 +8633,7 @@ var getBeamLine = async (lines, runDataList, pcdData, lineReader, lineEditor, on
8632
8633
  direction: line2.direction,
8633
8634
  drawWindow: newDrawWindowData3,
8634
8635
  isWindow: newDrawWindowData3.length > 0,
8636
+ isHoleWindow: newDrawWindowData3.length > 0,
8635
8637
  doorAndBeamIdToCheckResults: newDoorAndBeamIdToCheckResults3,
8636
8638
  checkResults: newCheckResults3
8637
8639
  };
@@ -9530,6 +9532,7 @@ var getColLine = async (lines, runDataList, collectDataPath, pointCloudCluster =
9530
9532
  for (let i = 0; i < lines2.length; i++) {
9531
9533
  let len = lines2[i].checkResults[0].allCenterPoints.length;
9532
9534
  const allCenterPoints = lines2[i].allCenterPoints;
9535
+ if (!allCenterPoints || allCenterPoints.length === 0) continue;
9533
9536
  let newPoints = [];
9534
9537
  if (pointCloudCluster != null) {
9535
9538
  let clusterResult = pointCloudCluster([allCenterPoints], {
@@ -12246,6 +12249,24 @@ var getMergeMeaning = (allProjectionResults, wallLines, wallVerifyType, averageP
12246
12249
  if (!averagePz2) averagePz2 = allProjectionResults[0].averagePz;
12247
12250
  const pcdPointsArr = [];
12248
12251
  const mapMaxSortFloor = /* @__PURE__ */ new Map();
12252
+ const CELL = 0.1;
12253
+ const grid = /* @__PURE__ */ new Map();
12254
+ const rectRegions = [];
12255
+ if (wallLines) {
12256
+ for (const line2 of wallLines) {
12257
+ for (const p2 of line2.originalPoints) {
12258
+ const key = `${Math.floor(p2.x / CELL)},${Math.floor(p2.y / CELL)},${Math.floor(p2.z / CELL)}`;
12259
+ if (!grid.has(key)) grid.set(key, []);
12260
+ grid.get(key).push(p2);
12261
+ }
12262
+ const rect = [];
12263
+ rect.push(getPt3(line2.start));
12264
+ rect.push(getPt3(line2.end));
12265
+ rect.push(getPt3(new THREE8.Vector3(line2.end.x, line2.end.y, line2.rooftopPz ? line2.rooftopPz : line2.end.z)));
12266
+ rect.push(getPt3(new THREE8.Vector3(line2.start.x, line2.start.y, line2.rooftopPz ? line2.rooftopPz : line2.start.z)));
12267
+ rectRegions.push(rect);
12268
+ }
12269
+ }
12249
12270
  for (let i = 0; i < allProjectionResults.length; i++) {
12250
12271
  let points = allProjectionResults[i].points.map((p) => [p.x, p.y]);
12251
12272
  let obj_id = allProjectionResults[i].obj_id;
@@ -12284,9 +12305,9 @@ var getMergeMeaning = (allProjectionResults, wallLines, wallVerifyType, averageP
12284
12305
  }
12285
12306
  if (wallLines) {
12286
12307
  if (wallVerifyType.type1 && wallVerifyType.type1.length && wallVerifyType.type1.includes(word))
12287
- threePoints = checkNearObjects(wallLines, threePoints);
12308
+ threePoints = checkNearObjects(grid, rectRegions, threePoints);
12288
12309
  else if (wallVerifyType.type2 && wallVerifyType.type2.length && wallVerifyType.type2.includes(word))
12289
- threePoints = checkNearObjects(wallLines, threePoints, true);
12310
+ threePoints = checkNearObjects(grid, rectRegions, threePoints, true);
12290
12311
  }
12291
12312
  let floorZ = -99999;
12292
12313
  if (word === "floor") {
@@ -12453,7 +12474,6 @@ var getMergeMeaning = (allProjectionResults, wallLines, wallVerifyType, averageP
12453
12474
  for (let i = 0; i < pcdPointsArr.length; i++) {
12454
12475
  const array = pcdPointsArr[i].array;
12455
12476
  const delData = /* @__PURE__ */ new Set();
12456
- const mergeData = [];
12457
12477
  for (let j = 0; j < array.length; j++) {
12458
12478
  if (array[j].obb == null || delData.has(j))
12459
12479
  continue;
@@ -12527,7 +12547,6 @@ var getMergeMeaning = (allProjectionResults, wallLines, wallVerifyType, averageP
12527
12547
  }
12528
12548
  if (isMerge) {
12529
12549
  delData.add(k);
12530
- let nowIndex = cloneData.points.length;
12531
12550
  let threePoints = [];
12532
12551
  let threePointsStr = [];
12533
12552
  for (let m = 0; m < array[k].points.length; m++) {
@@ -14560,24 +14579,9 @@ function obbContainsPoint(obb, point2, epsilon3 = 1e-6) {
14560
14579
  const z = v2.dot(zAxis);
14561
14580
  return Math.abs(x) <= h.x + epsilon3 && Math.abs(y) <= h.y + epsilon3 && Math.abs(z) <= h.z + epsilon3;
14562
14581
  }
14563
- var checkNearObjects = (lines, objPoints, delWallPoints = false) => {
14582
+ var checkNearObjects = (grid, rectRegions, objPoints, delWallPoints = false) => {
14564
14583
  const CELL = 0.1;
14565
- const grid = /* @__PURE__ */ new Map();
14566
14584
  const THRESHOLD_SQ = 0.03 * 0.03;
14567
- const rectRegions = [];
14568
- for (const line2 of lines) {
14569
- for (const p2 of line2.originalPoints) {
14570
- const key = `${Math.floor(p2.x / CELL)},${Math.floor(p2.y / CELL)},${Math.floor(p2.z / CELL)}`;
14571
- if (!grid.has(key)) grid.set(key, []);
14572
- grid.get(key).push(p2);
14573
- }
14574
- const rect = [];
14575
- rect.push(getPt3(line2.start));
14576
- rect.push(getPt3(line2.end));
14577
- rect.push(getPt3(new THREE8.Vector3(line2.end.x, line2.end.y, line2.rooftopPz ? line2.rooftopPz : line2.end.z)));
14578
- rect.push(getPt3(new THREE8.Vector3(line2.start.x, line2.start.y, line2.rooftopPz ? line2.rooftopPz : line2.start.z)));
14579
- rectRegions.push(rect);
14580
- }
14581
14585
  function hasNearbyPoint(p) {
14582
14586
  const cx = Math.floor(p.x / CELL);
14583
14587
  const cy = Math.floor(p.y / CELL);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rm-graphical-computing-node",
3
- "version": "1.0.148",
3
+ "version": "1.0.150",
4
4
  "description": "墙体/梁线/点云语义计算库(依赖 Python 与 three.js)",
5
5
  "type": "module",
6
6
  "main": "dist/index.mjs",