rm-graphical-computing-node 1.0.47 → 1.0.49

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 +32 -25
  2. package/package.json +1 -1
package/dist/index.mjs CHANGED
@@ -10844,12 +10844,13 @@ var getFlatSlabData = (lines, runDataList, pointCloudCluster = null) => {
10844
10844
  // src/geometry/window.mjs
10845
10845
  import * as THREE10 from "three";
10846
10846
  import { mergeGeometries as mergeGeometries5 } from "three/examples/jsm/utils/BufferGeometryUtils.js";
10847
- var getWindowData = (lines, pcdData) => {
10847
+ var getWindowData = (lines, pcdData, lineReader) => {
10848
10848
  if (lines.length <= 0 || !pcdData)
10849
10849
  return lines;
10850
10850
  if (!pcdData) pcdData = [];
10851
10851
  for (let line2 of lines) {
10852
10852
  let allRegion = [];
10853
+ line2.checkResults = lineReader.getLineCheckReultsById(line2.id);
10853
10854
  if (!line2.checkResults || line2.checkResults.length <= 0)
10854
10855
  continue;
10855
10856
  for (let r = 0; r < line2.checkResults.length; r++) {
@@ -10934,6 +10935,7 @@ var getWindowData = (lines, pcdData) => {
10934
10935
  }
10935
10936
  allRegion.push(...val);
10936
10937
  }
10938
+ line2.checkResults = null;
10937
10939
  line2.mergeCheckRegion = allRegion;
10938
10940
  }
10939
10941
  const windowDatas = [];
@@ -10978,11 +10980,14 @@ var getWindowData = (lines, pcdData) => {
10978
10980
  let nearDist = 0.25;
10979
10981
  for (let index = 0; index < lines.length; index++) {
10980
10982
  let line2 = lines[index];
10983
+ if (line2.length < 0.5) continue;
10981
10984
  if (line2.noDetection) continue;
10982
- if (!line2.doorAndBeamData)
10983
- line2.doorAndBeamData = [];
10984
- if (!line2.doorAndBeamIdToCheckResults)
10985
- line2.doorAndBeamIdToCheckResults = [];
10985
+ line2.originalPoints = lineReader.getOriginalPointsById(line2.id);
10986
+ line2.checkResults = lineReader.getLineCheckReultsById(line2.id);
10987
+ if (!line2.windowData)
10988
+ line2.windowData = [];
10989
+ if (!line2.windowIdToCheckResults)
10990
+ line2.windowIdToCheckResults = [];
10986
10991
  if (!line2.mergeCheckRegion || line2.mergeCheckRegion.length == 0)
10987
10992
  continue;
10988
10993
  line2.completePointAreaPercentage = -1;
@@ -11358,11 +11363,11 @@ var getWindowData = (lines, pcdData) => {
11358
11363
  pcbDoorIndexs,
11359
11364
  groundClearance
11360
11365
  };
11361
- line2.doorAndBeamIdToCheckResults.push([region.index, id]);
11362
- line2.doorAndBeamData.push(doorAndBeamDataObj);
11366
+ line2.windowIdToCheckResults.push([region.index, id]);
11367
+ line2.windowData.push(doorAndBeamDataObj);
11363
11368
  doorBeamDataIndex.push({
11364
11369
  linesIndex: index,
11365
- doorIndex: line2.doorAndBeamData.length - 1
11370
+ doorIndex: line2.windowData.length - 1
11366
11371
  });
11367
11372
  allDoorLines1.push({
11368
11373
  start: doorTmpSt,
@@ -11379,26 +11384,28 @@ var getWindowData = (lines, pcdData) => {
11379
11384
  }
11380
11385
  let faceArea = line2.length * (line2.rooftopPz - line2.start.z);
11381
11386
  line2.completePointAreaPercentage = totalArea / faceArea * 100;
11387
+ line2.checkResults = null;
11388
+ line2.originalPoints = null;
11382
11389
  }
11383
11390
  if (findDoorIndexs.length > 1) {
11384
11391
  for (let j = 0; j < findDoorIndexs.length; j++) {
11385
11392
  let savedata2 = [];
11386
- for (let d = 0; d < lines[findDoorIndexs[j]].doorAndBeamData.length; d++) {
11387
- if (lines[findDoorIndexs[j]].doorAndBeamData[d].type != "window")
11393
+ for (let d = 0; d < lines[findDoorIndexs[j]].windowData.length; d++) {
11394
+ if (lines[findDoorIndexs[j]].windowData[d].type != "window")
11388
11395
  continue;
11389
11396
  let isDel = false;
11390
11397
  if (!isDel) {
11391
- let doorSt1 = lines[findDoorIndexs[j]].doorAndBeamData[d].windowBottomSt.clone();
11392
- let doorEd1 = lines[findDoorIndexs[j]].doorAndBeamData[d].windowBottomEd.clone();
11398
+ let doorSt1 = lines[findDoorIndexs[j]].windowData[d].windowBottomSt.clone();
11399
+ let doorEd1 = lines[findDoorIndexs[j]].windowData[d].windowBottomEd.clone();
11393
11400
  doorSt1.z = doorEd1.z = 0;
11394
11401
  let doorLen1 = doorSt1.distanceTo(doorEd1);
11395
11402
  for (let b = 0; b < findDoorIndexs.length; b++) {
11396
11403
  if (j == b) continue;
11397
- for (let r = 0; r < lines[findDoorIndexs[b]].doorAndBeamData.length; r++) {
11398
- if (lines[findDoorIndexs[b]].doorAndBeamData[r].type != "window")
11404
+ for (let r = 0; r < lines[findDoorIndexs[b]].windowData.length; r++) {
11405
+ if (lines[findDoorIndexs[b]].windowData[r].type != "window")
11399
11406
  continue;
11400
- let doorSt2 = lines[findDoorIndexs[b]].doorAndBeamData[r].windowBottomSt.clone();
11401
- let doorEd2 = lines[findDoorIndexs[b]].doorAndBeamData[r].windowBottomEd.clone();
11407
+ let doorSt2 = lines[findDoorIndexs[b]].windowData[r].windowBottomSt.clone();
11408
+ let doorEd2 = lines[findDoorIndexs[b]].windowData[r].windowBottomEd.clone();
11402
11409
  doorSt2.z = doorEd2.z = 0;
11403
11410
  let doorLen2 = doorSt2.distanceTo(doorEd2);
11404
11411
  let resultTmp = classifySegments(doorSt1, doorEd1, doorSt2, doorEd2);
@@ -11408,8 +11415,8 @@ var getWindowData = (lines, pcdData) => {
11408
11415
  let ptClose = line3.closestPointToPoint(ptMid, true, new THREE10.Vector3());
11409
11416
  let distTmp = ptMid.distanceTo(ptClose);
11410
11417
  if (Math.abs(doorLen1 - resultTmp.overlap) < 0.1 && distTmp < 0.04) {
11411
- if (lines[findDoorIndexs[b]].doorAndBeamData[r].nearId == lines[findDoorIndexs[j]].doorAndBeamData[d].id) {
11412
- lines[findDoorIndexs[b]].doorAndBeamData[r].nearId = -1;
11418
+ if (lines[findDoorIndexs[b]].windowData[r].nearId == lines[findDoorIndexs[j]].windowData[d].id) {
11419
+ lines[findDoorIndexs[b]].windowData[r].nearId = -1;
11413
11420
  }
11414
11421
  isDel = true;
11415
11422
  break;
@@ -11419,24 +11426,24 @@ var getWindowData = (lines, pcdData) => {
11419
11426
  }
11420
11427
  }
11421
11428
  if (isDel) {
11422
- for (let z = 0; z < lines[findDoorIndexs[j]].doorAndBeamIdToCheckResults.length; z++) {
11423
- if (lines[findDoorIndexs[j]].doorAndBeamIdToCheckResults[1] == lines[findDoorIndexs[j]].doorAndBeamData[d].id) {
11424
- lines[findDoorIndexs[j]].doorAndBeamIdToCheckResults.splice(z, 1);
11429
+ for (let z = 0; z < lines[findDoorIndexs[j]].windowIdToCheckResults.length; z++) {
11430
+ if (lines[findDoorIndexs[j]].windowIdToCheckResults[1] == lines[findDoorIndexs[j]].windowData[d].id) {
11431
+ lines[findDoorIndexs[j]].windowIdToCheckResults.splice(z, 1);
11425
11432
  break;
11426
11433
  }
11427
11434
  }
11428
11435
  }
11429
- if (!isDel) savedata2.push(lines[findDoorIndexs[j]].doorAndBeamData[d]);
11436
+ if (!isDel) savedata2.push(lines[findDoorIndexs[j]].windowData[d]);
11430
11437
  }
11431
- if (savedata2.length != lines[findDoorIndexs[j]].doorAndBeamData.length)
11432
- lines[findDoorIndexs[j]].doorAndBeamData = savedata2;
11438
+ if (savedata2.length != lines[findDoorIndexs[j]].windowData.length)
11439
+ lines[findDoorIndexs[j]].windowData = savedata2;
11433
11440
  }
11434
11441
  }
11435
11442
  let tmpLines = [];
11436
11443
  for (let i = 0; i < lines.length; i++) {
11437
11444
  if (!lines[i].isLine2)
11438
11445
  tmpLines.push(lines[i]);
11439
- if (lines[i].isLine2 && lines[i].doorAndBeamData.length != 0)
11446
+ if (lines[i].isLine2 && lines[i].windowData.length != 0)
11440
11447
  tmpLines.push(lines[i]);
11441
11448
  }
11442
11449
  lines.length = 0;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rm-graphical-computing-node",
3
- "version": "1.0.47",
3
+ "version": "1.0.49",
4
4
  "description": "墙体/梁线/点云语义计算库(依赖 Python 与 three.js)",
5
5
  "type": "module",
6
6
  "main": "dist/index.mjs",