rm-graphical-computing-node 1.0.153 → 1.0.154

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 +27 -10
  2. package/package.json +1 -1
package/dist/index.mjs CHANGED
@@ -8044,9 +8044,10 @@ function getTrendLineEndpoints(points, options = {}) {
8044
8044
  // src/geometry/beamLine.mjs
8045
8045
  import { randomUUID as randomUUID2 } from "crypto";
8046
8046
  var getBeamLine = async (lines, runDataList, pcdData, lineReader, lineEditor, onProgress = null) => {
8047
+ const beamGroup = [];
8047
8048
  removeNoisePoints(lines, lineReader, lineEditor);
8048
8049
  if (lines.length <= 0 || runDataList.length <= 0)
8049
- return lines;
8050
+ return { lines, beamGroup, pcdData };
8050
8051
  if (!pcdData) pcdData = [];
8051
8052
  for (let line2 of lines) {
8052
8053
  let allRegion = [];
@@ -8258,7 +8259,6 @@ var getBeamLine = async (lines, runDataList, pcdData, lineReader, lineEditor, on
8258
8259
  let doorBeamDataIndex = [];
8259
8260
  let findDoorIndexs = [];
8260
8261
  let allDoorLines1 = [];
8261
- const beamGroup = [];
8262
8262
  let nearDist = 0.15;
8263
8263
  for (let index = 0; index < lines.length; index++) {
8264
8264
  if (onProgress != null)
@@ -8286,7 +8286,6 @@ var getBeamLine = async (lines, runDataList, pcdData, lineReader, lineEditor, on
8286
8286
  const totalInPlaneNum = region.totalInPlaneNum;
8287
8287
  if (!facePoints || facePoints.length <= 0)
8288
8288
  continue;
8289
- let regionLength = facePoints[0].distanceTo(facePoints[1]);
8290
8289
  let regionHeight = facePoints[0].distanceTo(facePoints[3]);
8291
8290
  const centerHeight = region.gridHeight * (regionHeight / region.gridHeight / 3 * 2) + region.gridHeight / 2;
8292
8291
  let linePt1 = new THREE5.Vector3(facePoints[0].x, facePoints[0].y, facePoints[0].z + centerHeight);
@@ -8915,8 +8914,6 @@ var getBeamLine = async (lines, runDataList, pcdData, lineReader, lineEditor, on
8915
8914
  groundClearance,
8916
8915
  obj_id
8917
8916
  };
8918
- let nearDistTmp = Infinity;
8919
- let findNearDoorIndex = false;
8920
8917
  let nearBeamSt = new THREE5.Vector3();
8921
8918
  let nearBeamEd = new THREE5.Vector3();
8922
8919
  let nearId = -1;
@@ -9320,7 +9317,6 @@ var getBeamLine = async (lines, runDataList, pcdData, lineReader, lineEditor, on
9320
9317
  nearId = doorAndBeamDataObj.nearId;
9321
9318
  nearBeamSt = tmpDoorBeamData.beamStart.clone();
9322
9319
  nearBeamEd = tmpDoorBeamData.beamEnd.clone();
9323
- findNearDoorIndex = true;
9324
9320
  nearLineIndex = doorBeamDataIndex[w2].linesIndex;
9325
9321
  nearDoorIndex = doorBeamDataIndex[w2].doorIndex;
9326
9322
  break;
@@ -14347,7 +14343,7 @@ var getMergeMeaning = (allProjectionResults, wallLines, wallVerifyType, averageP
14347
14343
  }
14348
14344
  if (
14349
14345
  /**array[k].type == 'door frame' || */
14350
- array[k].type == "window" || array[k].type == "metal framing of interior glass partitions"
14346
+ array[k].type == "window" || array[k].type == "metal framing of interior glass partitions" || array[k].type == "pipe"
14351
14347
  ) {
14352
14348
  let tol = array[k].type == "door frame" ? 0.5 : 0.5;
14353
14349
  let boxVecK = getObbLongSideDirection(array[k].obb);
@@ -17189,8 +17185,11 @@ var getWindowData = (lines, pcdData, lineReader) => {
17189
17185
  name: window.name,
17190
17186
  rectPts: window.coordinatesByArea.coordinates,
17191
17187
  obj_id: window.obj_id,
17192
- findLineIndex: []
17188
+ findLineIndex: [],
17193
17189
  //存储的数据格式是[[线索引,线的windowData索引]]
17190
+ mainId: -1,
17191
+ //存储主线索引,初始为-1
17192
+ mainLineLength: 0
17194
17193
  });
17195
17194
  }
17196
17195
  }
@@ -17292,7 +17291,8 @@ var getWindowData = (lines, pcdData, lineReader) => {
17292
17291
  if (length2 < 3.5) {
17293
17292
  for (let n = 0; n < windowDatas.length; n++) {
17294
17293
  if (windowDatas[n].isFind) {
17295
- continue;
17294
+ if (line2.length < windowDatas[n].mainLineLength)
17295
+ continue;
17296
17296
  }
17297
17297
  if (windowDatas[n].maxZ < tmpRegion.facePoints[0].z || windowDatas[n].minZ > tmpRegion.facePoints[2].z)
17298
17298
  continue;
@@ -17304,8 +17304,12 @@ var getWindowData = (lines, pcdData, lineReader) => {
17304
17304
  let bIsSoTall = Math.abs(tmpRegion.facePoints[2].z - windowDatas[n].maxZ) > 0.2;
17305
17305
  if (bIsTrue) {
17306
17306
  let result = classifySegments(doorSt.clone(), doorEd.clone(), beamSt.clone(), beamEd.clone(), {
17307
+ collinearAngleMax: THREE10.MathUtils.degToRad(10),
17307
17308
  distanceThreshold: 2
17308
17309
  });
17310
+ if (windowDatas[n].name == "210_front_window_001") {
17311
+ console.log(index, result);
17312
+ }
17309
17313
  if (result && result.type == "collinear_gap") {
17310
17314
  let ptCenter = getMid(doorSt, doorEd);
17311
17315
  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));
@@ -17675,7 +17679,9 @@ var getWindowData = (lines, pcdData, lineReader) => {
17675
17679
  }
17676
17680
  line2.windowIdToCheckResults.push([region.index, id]);
17677
17681
  line2.windowData.push(doorAndBeamDataObj);
17678
- windowDatas[findDoorDataIndex].findLineIndex = [index, line2.windowData.length - 1];
17682
+ windowDatas[findDoorDataIndex].mainLineLength = line2.length;
17683
+ windowDatas[findDoorDataIndex].mainId = id;
17684
+ windowDatas[findDoorDataIndex].findLineIndex.push([index, id]);
17679
17685
  doorBeamDataIndex.push({
17680
17686
  linesIndex: index,
17681
17687
  doorIndex: line2.windowData.length - 1
@@ -17699,6 +17705,17 @@ var getWindowData = (lines, pcdData, lineReader) => {
17699
17705
  line2.originalPoints = null;
17700
17706
  }
17701
17707
  if (findDoorIndexs.length > 1) {
17708
+ for (let w = 0; w < windowDatas.length; w++) {
17709
+ if (windowDatas[w].mainId == -1 || windowDatas[w].findLineIndex.length == 1) continue;
17710
+ const mainId = windowDatas[w].mainId;
17711
+ for (let f = 0; f < windowDatas[w].findLineIndex.length; f++) {
17712
+ const windowDataIndex = windowDatas[w].findLineIndex[f];
17713
+ const line2 = lines[windowDataIndex[0]];
17714
+ const windowDataId = windowDataIndex[1];
17715
+ if (!line2 || line2.windowData.length == 0 || mainId == windowDataId) continue;
17716
+ line2.windowData = line2.windowData.filter((wd) => wd.id != windowDataId);
17717
+ }
17718
+ }
17702
17719
  for (let j = 0; j < findDoorIndexs.length; j++) {
17703
17720
  let savedata2 = [];
17704
17721
  for (let d = 0; d < lines[findDoorIndexs[j]].windowData.length; d++) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rm-graphical-computing-node",
3
- "version": "1.0.153",
3
+ "version": "1.0.154",
4
4
  "description": "墙体/梁线/点云语义计算库(依赖 Python 与 three.js)",
5
5
  "type": "module",
6
6
  "main": "dist/index.mjs",