rm-graphical-computing-node 1.0.149 → 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 +22 -20
  2. package/package.json +1 -1
package/dist/index.mjs CHANGED
@@ -9532,6 +9532,7 @@ var getColLine = async (lines, runDataList, collectDataPath, pointCloudCluster =
9532
9532
  for (let i = 0; i < lines2.length; i++) {
9533
9533
  let len = lines2[i].checkResults[0].allCenterPoints.length;
9534
9534
  const allCenterPoints = lines2[i].allCenterPoints;
9535
+ if (!allCenterPoints || allCenterPoints.length === 0) continue;
9535
9536
  let newPoints = [];
9536
9537
  if (pointCloudCluster != null) {
9537
9538
  let clusterResult = pointCloudCluster([allCenterPoints], {
@@ -12248,6 +12249,24 @@ var getMergeMeaning = (allProjectionResults, wallLines, wallVerifyType, averageP
12248
12249
  if (!averagePz2) averagePz2 = allProjectionResults[0].averagePz;
12249
12250
  const pcdPointsArr = [];
12250
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
+ }
12251
12270
  for (let i = 0; i < allProjectionResults.length; i++) {
12252
12271
  let points = allProjectionResults[i].points.map((p) => [p.x, p.y]);
12253
12272
  let obj_id = allProjectionResults[i].obj_id;
@@ -12286,9 +12305,9 @@ var getMergeMeaning = (allProjectionResults, wallLines, wallVerifyType, averageP
12286
12305
  }
12287
12306
  if (wallLines) {
12288
12307
  if (wallVerifyType.type1 && wallVerifyType.type1.length && wallVerifyType.type1.includes(word))
12289
- threePoints = checkNearObjects(wallLines, threePoints);
12308
+ threePoints = checkNearObjects(grid, rectRegions, threePoints);
12290
12309
  else if (wallVerifyType.type2 && wallVerifyType.type2.length && wallVerifyType.type2.includes(word))
12291
- threePoints = checkNearObjects(wallLines, threePoints, true);
12310
+ threePoints = checkNearObjects(grid, rectRegions, threePoints, true);
12292
12311
  }
12293
12312
  let floorZ = -99999;
12294
12313
  if (word === "floor") {
@@ -12455,7 +12474,6 @@ var getMergeMeaning = (allProjectionResults, wallLines, wallVerifyType, averageP
12455
12474
  for (let i = 0; i < pcdPointsArr.length; i++) {
12456
12475
  const array = pcdPointsArr[i].array;
12457
12476
  const delData = /* @__PURE__ */ new Set();
12458
- const mergeData = [];
12459
12477
  for (let j = 0; j < array.length; j++) {
12460
12478
  if (array[j].obb == null || delData.has(j))
12461
12479
  continue;
@@ -12529,7 +12547,6 @@ var getMergeMeaning = (allProjectionResults, wallLines, wallVerifyType, averageP
12529
12547
  }
12530
12548
  if (isMerge) {
12531
12549
  delData.add(k);
12532
- let nowIndex = cloneData.points.length;
12533
12550
  let threePoints = [];
12534
12551
  let threePointsStr = [];
12535
12552
  for (let m = 0; m < array[k].points.length; m++) {
@@ -14562,24 +14579,9 @@ function obbContainsPoint(obb, point2, epsilon3 = 1e-6) {
14562
14579
  const z = v2.dot(zAxis);
14563
14580
  return Math.abs(x) <= h.x + epsilon3 && Math.abs(y) <= h.y + epsilon3 && Math.abs(z) <= h.z + epsilon3;
14564
14581
  }
14565
- var checkNearObjects = (lines, objPoints, delWallPoints = false) => {
14582
+ var checkNearObjects = (grid, rectRegions, objPoints, delWallPoints = false) => {
14566
14583
  const CELL = 0.1;
14567
- const grid = /* @__PURE__ */ new Map();
14568
14584
  const THRESHOLD_SQ = 0.03 * 0.03;
14569
- const rectRegions = [];
14570
- for (const line2 of lines) {
14571
- for (const p2 of line2.originalPoints) {
14572
- const key = `${Math.floor(p2.x / CELL)},${Math.floor(p2.y / CELL)},${Math.floor(p2.z / CELL)}`;
14573
- if (!grid.has(key)) grid.set(key, []);
14574
- grid.get(key).push(p2);
14575
- }
14576
- const rect = [];
14577
- rect.push(getPt3(line2.start));
14578
- rect.push(getPt3(line2.end));
14579
- rect.push(getPt3(new THREE8.Vector3(line2.end.x, line2.end.y, line2.rooftopPz ? line2.rooftopPz : line2.end.z)));
14580
- rect.push(getPt3(new THREE8.Vector3(line2.start.x, line2.start.y, line2.rooftopPz ? line2.rooftopPz : line2.start.z)));
14581
- rectRegions.push(rect);
14582
- }
14583
14585
  function hasNearbyPoint(p) {
14584
14586
  const cx = Math.floor(p.x / CELL);
14585
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.149",
3
+ "version": "1.0.150",
4
4
  "description": "墙体/梁线/点云语义计算库(依赖 Python 与 three.js)",
5
5
  "type": "module",
6
6
  "main": "dist/index.mjs",