rm-graphical-computing-node 1.0.80 → 1.0.82

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 +103 -5
  2. package/package.json +1 -1
package/dist/index.mjs CHANGED
@@ -12556,8 +12556,8 @@ var getDoorPcdData = (lines, pcdData) => {
12556
12556
  const line2 = tmpLines[maxIndex];
12557
12557
  let ptStart = getPt3(line2.start);
12558
12558
  let ptEnd = getPt3(line2.end);
12559
- let intersect1 = segmentsIntersect2D(ptStart, ptEnd, ptShortSt1, ptShortEd1, 0.05);
12560
- let intersect2 = segmentsIntersect2D(ptStart, ptEnd, ptShortSt2, ptShortEd2, 0.05);
12559
+ let intersect1 = segmentsIntersect2D(ptStart, ptEnd, ptShortSt1, ptShortEd1, 0.3);
12560
+ let intersect2 = segmentsIntersect2D(ptStart, ptEnd, ptShortSt2, ptShortEd2, 0.3);
12561
12561
  if (intersect1 != null && intersect2 != null) {
12562
12562
  if (line2.mergeIndexs) {
12563
12563
  let tmpIndex = [];
@@ -12632,14 +12632,112 @@ var getDoorPcdData = (lines, pcdData) => {
12632
12632
  isRebuild: false,
12633
12633
  direction: line2.direction
12634
12634
  };
12635
- if (newLine1.originalPoints.length > 0)
12635
+ if (newLine1.originalPoints.length > 0 && newLine1.length > 0.01)
12636
12636
  lines.push(newLine1);
12637
- if (newLine2.originalPoints.length > 0)
12637
+ if (newLine2.originalPoints.length > 0 && newLine2.length > 0.01)
12638
12638
  lines.push(newLine2);
12639
- if (newLine3.originalPoints.length > 0)
12639
+ if (newLine3.originalPoints.length > 0 && newLine3.length > 0.01)
12640
12640
  lines.push(newLine3);
12641
12641
  pcd.isFindDoor = true;
12642
12642
  line2.isRebuild = true;
12643
+ } else if (intersect1 == null && intersect2 == null) {
12644
+ ptShortSt1.z = ptShortEd1.z = ptShortSt2.z = ptShortEd2.z = line2.start.z;
12645
+ let shortLine1 = new THREE11.Line3(ptShortSt1, ptShortEd1);
12646
+ let shortLine2 = new THREE11.Line3(ptShortSt2, ptShortEd2);
12647
+ let ptClose1 = shortLine1.closestPointToPoint(ptStart, true, new THREE11.Vector3());
12648
+ let ptClose2 = shortLine1.closestPointToPoint(ptEnd, true, new THREE11.Vector3());
12649
+ let ptClose3 = shortLine2.closestPointToPoint(ptStart, true, new THREE11.Vector3());
12650
+ let ptClose4 = shortLine2.closestPointToPoint(ptEnd, true, new THREE11.Vector3());
12651
+ let dist1 = ptClose1.distanceTo(ptStart);
12652
+ let dist2 = ptClose2.distanceTo(ptEnd);
12653
+ let dist3 = ptClose3.distanceTo(ptStart);
12654
+ let dist4 = ptClose4.distanceTo(ptEnd);
12655
+ let nearDist = 0.2;
12656
+ if ((dist1 < nearDist || dist2 < nearDist) && (dist3 < nearDist || dist4 < nearDist)) {
12657
+ if (line2.mergeIndexs) {
12658
+ let tmpIndex = [];
12659
+ for (let h = 0; h < line2.mergeIndexs.length; h++) {
12660
+ tmpIndex.push(eligibilityLinesIndexs[line2.mergeIndexs[h]]);
12661
+ }
12662
+ for (let h = 0; h < lines.length; h++) {
12663
+ if (tmpIndex.includes(h))
12664
+ lines[h].isRebuild = true;
12665
+ }
12666
+ }
12667
+ let ptDoorSt = ptClose1.clone();
12668
+ let ptDoorEd = ptClose3.clone();
12669
+ if (dist2 < nearDist)
12670
+ ptDoorSt = ptClose2.clone();
12671
+ if (dist4 < nearDist)
12672
+ ptDoorEd = ptClose4.clone();
12673
+ const newOriginPts1 = getProjectedPointOnLine(ptStart, ptDoorSt, line2.originalPoints);
12674
+ const newOriginPts2 = getProjectedPointOnLine(ptDoorSt, ptDoorEd, line2.originalPoints);
12675
+ const newOriginPts3 = getProjectedPointOnLine(ptDoorEd, ptEnd, line2.originalPoints);
12676
+ const newDoorAndBeamData1 = [];
12677
+ const newDoorAndBeamData2 = [];
12678
+ const newDoorAndBeamData3 = [];
12679
+ if (line2.doorAndBeamData) {
12680
+ for (let a = 0; a < line2.doorAndBeamData.length; a++) {
12681
+ let doorStart = line2.doorAndBeamData[a].doorStart;
12682
+ let doorEnd = line2.doorAndBeamData[a].doorEnd;
12683
+ if (isPointOnLine2(ptStart, ptDoorSt, doorStart, 1e-3, true) && isPointOnLine2(ptStart, ptDoorSt, doorEnd, 1e-3, true))
12684
+ newDoorAndBeamData1.push(line2.doorAndBeamData[a]);
12685
+ else if (isPointOnLine2(ptDoorEd, ptEnd, doorStart, 1e-3, true) && isPointOnLine2(ptDoorEd, ptEnd, doorEnd, 1e-3, true))
12686
+ newDoorAndBeamData3.push(line2.doorAndBeamData[a]);
12687
+ }
12688
+ }
12689
+ let groundClearance = minZ - line2.start.z;
12690
+ groundClearance = groundClearance > 0.01 ? groundClearance : 0;
12691
+ let newLine1 = {
12692
+ start: ptStart,
12693
+ end: ptDoorSt,
12694
+ length: ptStart.distanceTo(ptDoorSt),
12695
+ originalPoints: newOriginPts1.newOriginalPoints,
12696
+ doorAndBeamData: newDoorAndBeamData1,
12697
+ id: randomUUID2(),
12698
+ rooftopPz: line2.rooftopPz,
12699
+ isRebuild: false,
12700
+ direction: line2.direction
12701
+ };
12702
+ let newLine2 = {
12703
+ start: ptDoorSt,
12704
+ end: ptDoorEd,
12705
+ length: ptDoorSt.distanceTo(ptDoorEd),
12706
+ originalPoints: newOriginPts2.newOriginalPoints,
12707
+ doorAndBeamData: newDoorAndBeamData2,
12708
+ id: randomUUID2(),
12709
+ rooftopPz: line2.rooftopPz,
12710
+ isRebuild: false,
12711
+ direction: line2.direction,
12712
+ drawDoorData: {
12713
+ start: new THREE11.Vector3(ptDoorSt.x, ptDoorSt.y, line2.start.z),
12714
+ end: new THREE11.Vector3(ptDoorEd.x, ptDoorEd.y, line2.start.z),
12715
+ n: new THREE11.Vector3(0, 0, 0),
12716
+ height,
12717
+ groundClearance
12718
+ },
12719
+ isDoor: true
12720
+ };
12721
+ let newLine3 = {
12722
+ start: ptDoorEd,
12723
+ end: ptEnd,
12724
+ length: ptDoorEd.distanceTo(ptEnd),
12725
+ originalPoints: newOriginPts3.newOriginalPoints,
12726
+ doorAndBeamData: newDoorAndBeamData3,
12727
+ id: randomUUID2(),
12728
+ rooftopPz: line2.rooftopPz,
12729
+ isRebuild: false,
12730
+ direction: line2.direction
12731
+ };
12732
+ if (newLine1.originalPoints.length > 0 && newLine1.length > 0.01)
12733
+ lines.push(newLine1);
12734
+ if (newLine2.originalPoints.length > 0 && newLine2.length > 0.01)
12735
+ lines.push(newLine2);
12736
+ if (newLine3.originalPoints.length > 0 && newLine3.length > 0.01)
12737
+ lines.push(newLine3);
12738
+ pcd.isFindDoor = true;
12739
+ line2.isRebuild = true;
12740
+ }
12643
12741
  }
12644
12742
  }
12645
12743
  return lines;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rm-graphical-computing-node",
3
- "version": "1.0.80",
3
+ "version": "1.0.82",
4
4
  "description": "墙体/梁线/点云语义计算库(依赖 Python 与 three.js)",
5
5
  "type": "module",
6
6
  "main": "dist/index.mjs",