rm-graphical-computing-node 1.0.37 → 1.0.39
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.
- package/dist/index.mjs +191 -179
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -3150,12 +3150,8 @@ var removeNoisePoints = (lines, lineReader, lineEditor) => {
|
|
|
3150
3150
|
continue;
|
|
3151
3151
|
let gridWidth = -1;
|
|
3152
3152
|
let gridHeight = -1;
|
|
3153
|
-
|
|
3154
|
-
|
|
3155
|
-
tempLineI.originalPoints = lineReader.getOriginalPointsById(line2.id);
|
|
3156
|
-
line2.originalPoints = tempLineI.originalPoints;
|
|
3157
|
-
line2.checkResults = tempLineI.checkResults;
|
|
3158
|
-
tempLineI = null;
|
|
3153
|
+
line2.originalPoints = lineReader.getOriginalPointsById(line2.id);
|
|
3154
|
+
line2.checkResults = lineReader.getLineCheckReultsById(line2.id);
|
|
3159
3155
|
if (!line2.checkResults || line2.checkResults.length <= 0)
|
|
3160
3156
|
continue;
|
|
3161
3157
|
for (let a = 0; a < line2.checkResults.length; a++) {
|
|
@@ -3728,16 +3724,14 @@ function getTrendLineEndpoints(points, options = {}) {
|
|
|
3728
3724
|
|
|
3729
3725
|
// src/geometry/beamLine.mjs
|
|
3730
3726
|
import { Line as Line2 } from "three";
|
|
3731
|
-
var getBeamLine = async (lines, runDataList, pcdData, lineReader, lineEditor,
|
|
3727
|
+
var getBeamLine = async (lines, runDataList, pcdData, lineReader, lineEditor, onProgress = null) => {
|
|
3732
3728
|
removeNoisePoints(lines, lineReader, lineEditor);
|
|
3733
3729
|
if (lines.length <= 0 || runDataList.length <= 0)
|
|
3734
3730
|
return lines;
|
|
3735
3731
|
if (!pcdData) pcdData = [];
|
|
3736
3732
|
for (let line2 of lines) {
|
|
3737
3733
|
let allRegion = [];
|
|
3738
|
-
|
|
3739
|
-
tempLineI.checkResults = lineReader.getLineCheckReultsById(line2.id);
|
|
3740
|
-
line2.checkResults = tempLineI.checkResults;
|
|
3734
|
+
line2.checkResults = lineReader.getLineCheckReultsById(line2.id);
|
|
3741
3735
|
if (!line2.checkResults || line2.checkResults.length <= 0)
|
|
3742
3736
|
continue;
|
|
3743
3737
|
for (let r = 0; r < line2.checkResults.length; r++) {
|
|
@@ -3922,14 +3916,12 @@ var getBeamLine = async (lines, runDataList, pcdData, lineReader, lineEditor, re
|
|
|
3922
3916
|
const beamGroup = [];
|
|
3923
3917
|
let nearDist = 0.15;
|
|
3924
3918
|
for (let index = 0; index < lines.length; index++) {
|
|
3919
|
+
if (onProgress != null)
|
|
3920
|
+
onProgress((index + 1) / lines.length * 60);
|
|
3925
3921
|
let line2 = lines[index];
|
|
3926
3922
|
if (line2.noDetection) continue;
|
|
3927
|
-
|
|
3928
|
-
|
|
3929
|
-
tempLineIndex.checkResults = lineReader.getLineCheckReultsById(line2.id);
|
|
3930
|
-
line2.originalPoints = tempLineIndex.originalPoints;
|
|
3931
|
-
line2.checkResults = tempLineIndex.checkResults;
|
|
3932
|
-
tempLineIndex = null;
|
|
3923
|
+
line2.originalPoints = lineReader.getOriginalPointsById(line2.id);
|
|
3924
|
+
line2.checkResults = lineReader.getLineCheckReultsById(line2.id);
|
|
3933
3925
|
line2.doorAndBeamData = [];
|
|
3934
3926
|
line2.doorAndBeamIdToCheckResults = [];
|
|
3935
3927
|
if (!line2.mergeCheckRegion || line2.mergeCheckRegion.length == 0)
|
|
@@ -4117,7 +4109,7 @@ var getBeamLine = async (lines, runDataList, pcdData, lineReader, lineEditor, re
|
|
|
4117
4109
|
const ptInsertTmp = segmentsIntersect2D(tmpLineStart, tmpLineEnd, tmpOtherLineStart, tmpOtherLineEnd, 0.1);
|
|
4118
4110
|
let isPerpendicularInfo = perpendicularInfo(tmpLineStart, tmpLineEnd, tmpOtherLineStart, tmpOtherLineEnd);
|
|
4119
4111
|
if (ptInsertTmp != null) {
|
|
4120
|
-
if (isPerpendicularInfo && isPerpendicularInfo.angle >
|
|
4112
|
+
if (isPerpendicularInfo && isPerpendicularInfo.angle > 79) {
|
|
4121
4113
|
let dist00 = ptInsertTmp.point.distanceTo(tmpLineStart);
|
|
4122
4114
|
let dist01 = ptInsertTmp.point.distanceTo(tmpLineEnd);
|
|
4123
4115
|
if (dist00 < 0.3) {
|
|
@@ -4129,7 +4121,7 @@ var getBeamLine = async (lines, runDataList, pcdData, lineReader, lineEditor, re
|
|
|
4129
4121
|
}
|
|
4130
4122
|
continue;
|
|
4131
4123
|
}
|
|
4132
|
-
if (isPerpendicularInfo && isPerpendicularInfo.angle >
|
|
4124
|
+
if (isPerpendicularInfo && isPerpendicularInfo.angle > 79) {
|
|
4133
4125
|
let tmpLine3 = new THREE5.Line3(tmpOtherLineStart, tmpOtherLineEnd);
|
|
4134
4126
|
const ptClose = tmpLine3.closestPointToPoint(tmpLineStart, true, ptTarget);
|
|
4135
4127
|
let isParallelism = getParallelism(tmpLineStart, tmpLineEnd, ptClose, tmpLineStart);
|
|
@@ -4155,10 +4147,7 @@ var getBeamLine = async (lines, runDataList, pcdData, lineReader, lineEditor, re
|
|
|
4155
4147
|
let tmpDist8 = getZZeroPointToPointDistance(tmpDoorEnd, tmpOtherLineEnd);
|
|
4156
4148
|
let isPPPP = getParallelism(tmpLineStart, tmpLineEnd, tmpOtherLineStart, tmpDoorStart);
|
|
4157
4149
|
let nearCheckResult = false;
|
|
4158
|
-
|
|
4159
|
-
tempLineF.checkResults = lineReader.getLineCheckReultsById(lines[f].id);
|
|
4160
|
-
lines[f].checkResults = tempLineF.checkResults;
|
|
4161
|
-
tempLineF = null;
|
|
4150
|
+
lines[f].checkResults = lineReader.getLineCheckReultsById(lines[f].id);
|
|
4162
4151
|
if (lines[f].checkResults) {
|
|
4163
4152
|
for (let a = 0; a < lines[f].checkResults.length; a++) {
|
|
4164
4153
|
let ptsTmpp = [];
|
|
@@ -4227,7 +4216,7 @@ var getBeamLine = async (lines, runDataList, pcdData, lineReader, lineEditor, re
|
|
|
4227
4216
|
const ptInsertTmp = segmentsIntersect2D(tmpLineStart, tmpLineEnd, tmpOtherLineStart, tmpOtherLineEnd, 0.03);
|
|
4228
4217
|
let isPerpendicularInfo = perpendicularInfo(tmpLineStart, tmpLineEnd, tmpOtherLineStart, tmpOtherLineEnd);
|
|
4229
4218
|
if (ptInsertTmp != null) {
|
|
4230
|
-
if (isPerpendicularInfo && isPerpendicularInfo.angle >
|
|
4219
|
+
if (isPerpendicularInfo && isPerpendicularInfo.angle > 79) {
|
|
4231
4220
|
let dist00 = ptInsertTmp.point.distanceTo(tmpLineStart);
|
|
4232
4221
|
let dist01 = ptInsertTmp.point.distanceTo(tmpLineEnd);
|
|
4233
4222
|
if (dist01 < 0.3) {
|
|
@@ -4239,7 +4228,7 @@ var getBeamLine = async (lines, runDataList, pcdData, lineReader, lineEditor, re
|
|
|
4239
4228
|
}
|
|
4240
4229
|
continue;
|
|
4241
4230
|
}
|
|
4242
|
-
if (isPerpendicularInfo && isPerpendicularInfo.angle >
|
|
4231
|
+
if (isPerpendicularInfo && isPerpendicularInfo.angle > 79) {
|
|
4243
4232
|
let tmpLine3 = new THREE5.Line3(tmpOtherLineStart, tmpOtherLineEnd);
|
|
4244
4233
|
const ptClose = tmpLine3.closestPointToPoint(tmpLineEnd, true, ptTarget);
|
|
4245
4234
|
let isParallelism = getParallelism(tmpLineEnd, tmpLineStart, ptClose, tmpLineEnd);
|
|
@@ -4265,10 +4254,7 @@ var getBeamLine = async (lines, runDataList, pcdData, lineReader, lineEditor, re
|
|
|
4265
4254
|
let tmpDist8 = getZZeroPointToPointDistance(tmpDoorEnd, tmpOtherLineEnd);
|
|
4266
4255
|
let isPPPP = getParallelism(tmpLineEnd, tmpLineStart, tmpOtherLineStart, tmpDoorStart);
|
|
4267
4256
|
let nearCheckResult = false;
|
|
4268
|
-
|
|
4269
|
-
tempLineF.checkResults = lineReader.getLineCheckReultsById(lines[f].id);
|
|
4270
|
-
lines[f].checkResults = tempLineF.checkResults;
|
|
4271
|
-
tempLineF = null;
|
|
4257
|
+
lines[f].checkResults = lineReader.getLineCheckReultsById(lines[f].id);
|
|
4272
4258
|
if (lines[f].checkResults) {
|
|
4273
4259
|
for (let a = 0; a < lines[f].checkResults.length; a++) {
|
|
4274
4260
|
let ptsTmpp = [];
|
|
@@ -4662,10 +4648,7 @@ var getBeamLine = async (lines, runDataList, pcdData, lineReader, lineEditor, re
|
|
|
4662
4648
|
}
|
|
4663
4649
|
}
|
|
4664
4650
|
const allTmpPoints = [];
|
|
4665
|
-
|
|
4666
|
-
tempLineX.originalPoints = lineReader.getOriginalPointsById(lines[x].id);
|
|
4667
|
-
lines[x].originalPoints = tempLineX.originalPoints;
|
|
4668
|
-
tempLineX = null;
|
|
4651
|
+
lines[x].originalPoints = lineReader.getOriginalPointsById(lines[x].id);
|
|
4669
4652
|
lines[x].originalPoints.forEach((item) => {
|
|
4670
4653
|
if (item.z > doorTmpSt.z + 0.2 && item.z < doorTmpSt.z + height / 2)
|
|
4671
4654
|
allTmpPoints.push(new THREE5.Vector3(item.x, item.y, doorTmpSt.z));
|
|
@@ -4829,10 +4812,7 @@ var getBeamLine = async (lines, runDataList, pcdData, lineReader, lineEditor, re
|
|
|
4829
4812
|
let lineIsOnlyBeam1 = false;
|
|
4830
4813
|
let lineIsOnlyBeam2 = false;
|
|
4831
4814
|
if (doorAndBeamDataObj.type == "beam" && tmpDoorBeamData.type == "beam") {
|
|
4832
|
-
|
|
4833
|
-
tempLineT.originalPoints = lineReader.getOriginalPointsById(lines[doorBeamDataIndex[w2].linesIndex].id);
|
|
4834
|
-
lines[doorBeamDataIndex[w2].linesIndex].originalPoints = tempLineT.originalPoints;
|
|
4835
|
-
tempLineT = null;
|
|
4815
|
+
lines[doorBeamDataIndex[w2].linesIndex].originalPoints = lineReader.getOriginalPointsById(lines[doorBeamDataIndex[w2].linesIndex].id);
|
|
4836
4816
|
let Z1 = getPointsMinAndMax(lines[doorBeamDataIndex[w2].linesIndex].originalPoints);
|
|
4837
4817
|
let Z2 = getPointsMinAndMax(line2.originalPoints);
|
|
4838
4818
|
lines[doorBeamDataIndex[w2].linesIndex].originalPoints = null;
|
|
@@ -4964,6 +4944,8 @@ var getBeamLine = async (lines, runDataList, pcdData, lineReader, lineEditor, re
|
|
|
4964
4944
|
}
|
|
4965
4945
|
if (findDoorIndexs.length > 1) {
|
|
4966
4946
|
for (let j = 0; j < findDoorIndexs.length; j++) {
|
|
4947
|
+
if (onProgress != null)
|
|
4948
|
+
onProgress(60 + (j + 1) / findDoorIndexs.length * 5);
|
|
4967
4949
|
let savedata2 = [];
|
|
4968
4950
|
for (let d = 0; d < lines[findDoorIndexs[j]].doorAndBeamData.length; d++) {
|
|
4969
4951
|
let isDel = false;
|
|
@@ -5020,142 +5002,149 @@ var getBeamLine = async (lines, runDataList, pcdData, lineReader, lineEditor, re
|
|
|
5020
5002
|
let maxDoorLength = 2;
|
|
5021
5003
|
let isFindWallIndex = [];
|
|
5022
5004
|
let allDoorLines = [];
|
|
5023
|
-
|
|
5024
|
-
|
|
5025
|
-
|
|
5026
|
-
|
|
5027
|
-
|
|
5028
|
-
let vec1 = new THREE5.Vector3().subVectors(doorSt, doorEd).normalize();
|
|
5029
|
-
for (let j = 0; j < lines.length; j++) {
|
|
5030
|
-
if (lines[j].length < 0.7 || lines[j].completePointAreaPercentage > 60)
|
|
5005
|
+
if (doorDatas.length > 0) {
|
|
5006
|
+
for (let n = 0; n < doorDatas.length; n++) {
|
|
5007
|
+
if (onProgress != null)
|
|
5008
|
+
onProgress(65 + (n + 1) / doorDatas.length * 35);
|
|
5009
|
+
if (doorDatas[n].isFind || doorDatas[n].inWall)
|
|
5031
5010
|
continue;
|
|
5032
|
-
let
|
|
5033
|
-
let
|
|
5034
|
-
let
|
|
5035
|
-
let
|
|
5036
|
-
|
|
5037
|
-
|
|
5038
|
-
|
|
5039
|
-
|
|
5040
|
-
|
|
5041
|
-
|
|
5042
|
-
doorStExtended,
|
|
5043
|
-
doorEdExtended,
|
|
5044
|
-
beamStExtended,
|
|
5045
|
-
beamEdExtended
|
|
5046
|
-
|
|
5047
|
-
|
|
5048
|
-
|
|
5049
|
-
|
|
5050
|
-
|
|
5051
|
-
|
|
5052
|
-
|
|
5053
|
-
let
|
|
5054
|
-
let
|
|
5055
|
-
let
|
|
5056
|
-
|
|
5057
|
-
|
|
5058
|
-
|
|
5059
|
-
let
|
|
5060
|
-
let
|
|
5061
|
-
let
|
|
5062
|
-
let
|
|
5063
|
-
|
|
5064
|
-
let newBeamEdOther = beamEdOther.clone().addScaledVector(vec4, 5);
|
|
5065
|
-
let isP = perpendicularInfo(beamSt, beamEd, beamStOther, beamEdOther);
|
|
5066
|
-
let isPP = classifySegments(beamSt, beamEd, beamStOther, beamEdOther);
|
|
5067
|
-
let isTmpInsert = segmentsIntersect2D(beamSt, beamEd, newBeamStOther, newBeamEdOther);
|
|
5068
|
-
let isInside = true;
|
|
5069
|
-
if (isTmpInsert != null) {
|
|
5070
|
-
isInside = isTmpInsert.point.distanceTo(beamSt) < nearDist || isTmpInsert.point.distanceTo(beamEd) < nearDist;
|
|
5071
|
-
}
|
|
5072
|
-
if ((isP && isP.angle > 85 || isPP && isPP.type == "collinear_gap") && isInside) {
|
|
5073
|
-
let line3 = new THREE5.Line3(beamSt, beamEd);
|
|
5074
|
-
let target = new THREE5.Vector3();
|
|
5075
|
-
let ptClose1 = line3.closestPointToPoint(beamStOther, true, target);
|
|
5076
|
-
let ptClose2 = line3.closestPointToPoint(beamEdOther, true, target);
|
|
5077
|
-
let dist1 = ptClose1.distanceTo(beamStOther);
|
|
5078
|
-
let dist23 = ptClose2.distanceTo(beamEdOther);
|
|
5079
|
-
let doorStartPt, doorEndPt;
|
|
5080
|
-
if (dist1 > dist23 && dist23 > minDoorLength) {
|
|
5081
|
-
doorStartPt = beamEdOther;
|
|
5082
|
-
doorEndPt = ptClose2;
|
|
5083
|
-
} else if (dist1 < dist23 && dist1 > minDoorLength) {
|
|
5084
|
-
doorStartPt = beamStOther;
|
|
5085
|
-
doorEndPt = ptClose1;
|
|
5086
|
-
} else
|
|
5087
|
-
continue;
|
|
5088
|
-
dist1 = nearDoorPt.distanceTo(beamStOther);
|
|
5089
|
-
dist23 = nearDoorPt.distanceTo(beamEdOther);
|
|
5090
|
-
if (dist1 > maxDoorLength && dist23 > maxDoorLength)
|
|
5091
|
-
continue;
|
|
5092
|
-
let isPP2 = getParallelism(doorStartPt, doorEndPt, beamStOther, beamEdOther);
|
|
5093
|
-
let isPPP = getParallelism(doorStartPt, doorEndPt, doorStExtended, doorEdExtended);
|
|
5094
|
-
if (isPPP && isPPP.isParallel)
|
|
5095
|
-
continue;
|
|
5096
|
-
if (!isPP2 || !isPP2.isParallel)
|
|
5097
|
-
continue;
|
|
5098
|
-
let resOverlap = classifySegments(doorSt, doorEd, doorStartPt, doorEndPt);
|
|
5099
|
-
if (resOverlap && resOverlap.type == "collinear_overlap" && resOverlap.maxPerpendicularDistance < 0.2)
|
|
5011
|
+
let doorSt = new THREE5.Vector3(doorDatas[n].doorStartPt.x, doorDatas[n].doorStartPt.y, 0);
|
|
5012
|
+
let doorEd = new THREE5.Vector3(doorDatas[n].doorEndPt.x, doorDatas[n].doorEndPt.y, 0);
|
|
5013
|
+
let vec1 = new THREE5.Vector3().subVectors(doorSt, doorEd).normalize();
|
|
5014
|
+
for (let j = 0; j < lines.length; j++) {
|
|
5015
|
+
if (lines[j].length < 0.7 || lines[j].completePointAreaPercentage > 60)
|
|
5016
|
+
continue;
|
|
5017
|
+
let beamSt = new THREE5.Vector3(lines[j].start.x, lines[j].start.y, 0);
|
|
5018
|
+
let beamEd = new THREE5.Vector3(lines[j].end.x, lines[j].end.y, 0);
|
|
5019
|
+
let vec2 = new THREE5.Vector3().subVectors(beamSt, beamEd).normalize();
|
|
5020
|
+
let nExtend = 0.3;
|
|
5021
|
+
let doorStExtended = doorSt.clone().addScaledVector(vec1, nExtend);
|
|
5022
|
+
let doorEdExtended = doorEd.clone().addScaledVector(vec1.clone().negate(), nExtend);
|
|
5023
|
+
let beamStExtended = beamSt.clone().addScaledVector(vec2, nExtend);
|
|
5024
|
+
let beamEdExtended = beamEd.clone().addScaledVector(vec2.clone().negate(), nExtend);
|
|
5025
|
+
let insertPt = segmentsIntersect2D(doorStExtended, doorEdExtended, beamStExtended, beamEdExtended);
|
|
5026
|
+
let isDoorParBeam = getParallelism(
|
|
5027
|
+
doorStExtended,
|
|
5028
|
+
doorEdExtended,
|
|
5029
|
+
beamStExtended,
|
|
5030
|
+
beamEdExtended
|
|
5031
|
+
);
|
|
5032
|
+
let ptNear = doorSt.distanceTo(beamSt) > doorEd.distanceTo(beamSt) ? doorEd : doorSt;
|
|
5033
|
+
let dist11 = ptNear.distanceTo(beamSt);
|
|
5034
|
+
let dist22 = ptNear.distanceTo(beamEd);
|
|
5035
|
+
let isNear = dist11 < nearDist || dist22 < nearDist;
|
|
5036
|
+
if (isNear && isDoorParBeam && !isDoorParBeam.isParallel) {
|
|
5037
|
+
let nearDoorDist1 = doorSt.distanceTo(beamSt);
|
|
5038
|
+
let nearDoorDist2 = doorSt.distanceTo(beamEd);
|
|
5039
|
+
let nearDoorPt = nearDoorDist1 < nearDoorDist2 ? beamSt : beamEd;
|
|
5040
|
+
let findLine = false;
|
|
5041
|
+
for (let k = 0; k < lines.length; k++) {
|
|
5042
|
+
if (k == j || isFindWallIndex.includes(k) || lines[k].length < 0.7)
|
|
5100
5043
|
continue;
|
|
5101
|
-
|
|
5102
|
-
let
|
|
5103
|
-
|
|
5104
|
-
|
|
5105
|
-
|
|
5106
|
-
|
|
5107
|
-
|
|
5108
|
-
|
|
5044
|
+
let beamStOther = new THREE5.Vector3(lines[k].start.x, lines[k].start.y, 0);
|
|
5045
|
+
let beamEdOther = new THREE5.Vector3(lines[k].end.x, lines[k].end.y, 0);
|
|
5046
|
+
let vec32 = new THREE5.Vector3().subVectors(beamStOther, beamEdOther).normalize();
|
|
5047
|
+
let vec4 = vec32.clone().negate();
|
|
5048
|
+
let newBeamStOther = beamStOther.clone().addScaledVector(vec32, 5);
|
|
5049
|
+
let newBeamEdOther = beamEdOther.clone().addScaledVector(vec4, 5);
|
|
5050
|
+
let isP = perpendicularInfo(beamSt, beamEd, beamStOther, beamEdOther);
|
|
5051
|
+
let isPP = classifySegments(beamSt, beamEd, beamStOther, beamEdOther);
|
|
5052
|
+
let isTmpInsert = segmentsIntersect2D(beamSt, beamEd, newBeamStOther, newBeamEdOther);
|
|
5053
|
+
let isInside = true;
|
|
5054
|
+
if (isTmpInsert != null) {
|
|
5055
|
+
isInside = isTmpInsert.point.distanceTo(beamSt) < nearDist || isTmpInsert.point.distanceTo(beamEd) < nearDist;
|
|
5109
5056
|
}
|
|
5110
|
-
if (
|
|
5111
|
-
|
|
5112
|
-
|
|
5113
|
-
|
|
5114
|
-
let
|
|
5115
|
-
let
|
|
5116
|
-
let
|
|
5117
|
-
|
|
5118
|
-
|
|
5119
|
-
|
|
5057
|
+
if ((isP && isP.angle > 85 || isPP && isPP.type == "collinear_gap") && isInside) {
|
|
5058
|
+
let line3 = new THREE5.Line3(beamSt, beamEd);
|
|
5059
|
+
let target = new THREE5.Vector3();
|
|
5060
|
+
let ptClose1 = line3.closestPointToPoint(beamStOther, true, target);
|
|
5061
|
+
let ptClose2 = line3.closestPointToPoint(beamEdOther, true, target);
|
|
5062
|
+
let dist1 = ptClose1.distanceTo(beamStOther);
|
|
5063
|
+
let dist23 = ptClose2.distanceTo(beamEdOther);
|
|
5064
|
+
let doorStartPt, doorEndPt;
|
|
5065
|
+
if (dist1 > dist23 && dist23 > minDoorLength) {
|
|
5066
|
+
doorStartPt = beamEdOther;
|
|
5067
|
+
doorEndPt = ptClose2;
|
|
5068
|
+
} else if (dist1 < dist23 && dist1 > minDoorLength) {
|
|
5069
|
+
doorStartPt = beamStOther;
|
|
5070
|
+
doorEndPt = ptClose1;
|
|
5071
|
+
} else
|
|
5072
|
+
continue;
|
|
5073
|
+
dist1 = nearDoorPt.distanceTo(beamStOther);
|
|
5074
|
+
dist23 = nearDoorPt.distanceTo(beamEdOther);
|
|
5075
|
+
if (dist1 > maxDoorLength && dist23 > maxDoorLength)
|
|
5076
|
+
continue;
|
|
5077
|
+
let isPP2 = getParallelism(doorStartPt, doorEndPt, beamStOther, beamEdOther);
|
|
5078
|
+
let isPPP = getParallelism(doorStartPt, doorEndPt, doorStExtended, doorEdExtended);
|
|
5079
|
+
if (isPPP && isPPP.isParallel)
|
|
5080
|
+
continue;
|
|
5081
|
+
if (!isPP2 || !isPP2.isParallel)
|
|
5082
|
+
continue;
|
|
5083
|
+
let resOverlap = classifySegments(doorSt, doorEd, doorStartPt, doorEndPt);
|
|
5084
|
+
if (resOverlap && resOverlap.type == "collinear_overlap" && resOverlap.maxPerpendicularDistance < 0.2)
|
|
5085
|
+
continue;
|
|
5086
|
+
doorStartPt.z = doorEndPt.z = lines[k].start.z;
|
|
5087
|
+
let isOverlap = false;
|
|
5088
|
+
for (let m = 0; m < allDoorLines.length; m++) {
|
|
5089
|
+
let result = classifySegments(allDoorLines[m].start, allDoorLines[m].end, doorStartPt, doorEndPt);
|
|
5090
|
+
if (result && result.type == "collinear_overlap" && result.maxPerpendicularDistance < 0.2) {
|
|
5091
|
+
isOverlap = true;
|
|
5092
|
+
break;
|
|
5093
|
+
}
|
|
5120
5094
|
}
|
|
5095
|
+
if (isOverlap)
|
|
5096
|
+
continue;
|
|
5097
|
+
for (let x = 0; x < lines.length; x++) {
|
|
5098
|
+
if (lines[x].length < 0.5) continue;
|
|
5099
|
+
let startPt2 = new THREE5.Vector3(lines[x].start.x, lines[x].start.y, lines[x].start.z);
|
|
5100
|
+
let endPt2 = new THREE5.Vector3(lines[x].end.x, lines[x].end.y, lines[x].end.z);
|
|
5101
|
+
let result = classifySegments(startPt2, endPt2, doorStartPt, doorEndPt);
|
|
5102
|
+
if (result && result.type == "collinear_overlap" && result.maxPerpendicularDistance < 0.1) {
|
|
5103
|
+
isOverlap = true;
|
|
5104
|
+
break;
|
|
5105
|
+
}
|
|
5106
|
+
}
|
|
5107
|
+
if (isOverlap)
|
|
5108
|
+
continue;
|
|
5109
|
+
allDoorLines.push({
|
|
5110
|
+
start: doorStartPt,
|
|
5111
|
+
end: doorEndPt
|
|
5112
|
+
});
|
|
5113
|
+
isFindWallIndex.push(k);
|
|
5114
|
+
let height1 = lines[k].rooftopPz - lines[k].start.z;
|
|
5115
|
+
let height2 = lines[j].rooftopPz - lines[j].start.z;
|
|
5116
|
+
let doorHeight = height1 < height2 ? height1 : height2;
|
|
5117
|
+
if (!lines[k].doorAndBeamData)
|
|
5118
|
+
lines[k].doorAndBeamData = [];
|
|
5119
|
+
lines[k].doorAndBeamData.push({
|
|
5120
|
+
id,
|
|
5121
|
+
beamStart: doorStartPt,
|
|
5122
|
+
beamEnd: doorEndPt,
|
|
5123
|
+
beamHeight: doorHeight,
|
|
5124
|
+
doorStart: doorStartPt,
|
|
5125
|
+
doorEnd: doorEndPt,
|
|
5126
|
+
doorHeight,
|
|
5127
|
+
nearId: -1,
|
|
5128
|
+
type: "onlyDoor",
|
|
5129
|
+
isDoor: true,
|
|
5130
|
+
beamNearWallVec: new THREE5.Vector3(0, 0, 0),
|
|
5131
|
+
groundClearance: 0
|
|
5132
|
+
});
|
|
5133
|
+
pcdData[doorDatas[n].index].isFindBeam = true;
|
|
5134
|
+
pcdData[doorDatas[n].index].isFindOnlyDoor = true;
|
|
5135
|
+
beamGroup.push([{ id, beamStart: doorStartPt, beamEnd: doorEndPt }]);
|
|
5136
|
+
id++;
|
|
5137
|
+
findLine = true;
|
|
5138
|
+
break;
|
|
5121
5139
|
}
|
|
5122
|
-
if (isOverlap)
|
|
5123
|
-
continue;
|
|
5124
|
-
allDoorLines.push({
|
|
5125
|
-
start: doorStartPt,
|
|
5126
|
-
end: doorEndPt
|
|
5127
|
-
});
|
|
5128
|
-
isFindWallIndex.push(k);
|
|
5129
|
-
let height1 = lines[k].rooftopPz - lines[k].start.z;
|
|
5130
|
-
let height2 = lines[j].rooftopPz - lines[j].start.z;
|
|
5131
|
-
let doorHeight = height1 < height2 ? height1 : height2;
|
|
5132
|
-
if (!lines[k].doorAndBeamData)
|
|
5133
|
-
lines[k].doorAndBeamData = [];
|
|
5134
|
-
lines[k].doorAndBeamData.push({
|
|
5135
|
-
id,
|
|
5136
|
-
beamStart: doorStartPt,
|
|
5137
|
-
beamEnd: doorEndPt,
|
|
5138
|
-
beamHeight: doorHeight,
|
|
5139
|
-
doorStart: doorStartPt,
|
|
5140
|
-
doorEnd: doorEndPt,
|
|
5141
|
-
doorHeight,
|
|
5142
|
-
nearId: -1,
|
|
5143
|
-
type: "onlyDoor",
|
|
5144
|
-
isDoor: true,
|
|
5145
|
-
beamNearWallVec: new THREE5.Vector3(0, 0, 0),
|
|
5146
|
-
groundClearance: 0
|
|
5147
|
-
});
|
|
5148
|
-
pcdData[doorDatas[n].index].isFindBeam = true;
|
|
5149
|
-
pcdData[doorDatas[n].index].isFindOnlyDoor = true;
|
|
5150
|
-
beamGroup.push([{ id, beamStart: doorStartPt, beamEnd: doorEndPt }]);
|
|
5151
|
-
id++;
|
|
5152
|
-
findLine = true;
|
|
5153
|
-
break;
|
|
5154
5140
|
}
|
|
5141
|
+
if (findLine) break;
|
|
5155
5142
|
}
|
|
5156
|
-
if (findLine) break;
|
|
5157
5143
|
}
|
|
5158
5144
|
}
|
|
5145
|
+
} else {
|
|
5146
|
+
if (onProgress != null)
|
|
5147
|
+
onProgress(100);
|
|
5159
5148
|
}
|
|
5160
5149
|
let tmpLines = [];
|
|
5161
5150
|
for (let i = 0; i < lines.length; i++) {
|
|
@@ -5199,10 +5188,7 @@ var checkBeamIsReasonable = async (lines, lineReader) => {
|
|
|
5199
5188
|
doorAndBeamDataObj.beamNearWallVec = new THREE5.Vector3().subVectors(ptClose66, tmpPt66).normalize();
|
|
5200
5189
|
}
|
|
5201
5190
|
const allTmpPoints = [];
|
|
5202
|
-
|
|
5203
|
-
tempLineX.originalPoints = lineReader.getOriginalPointsById(lines[x].id);
|
|
5204
|
-
lines[x].originalPoints = tempLineX.originalPoints;
|
|
5205
|
-
tempLineX = null;
|
|
5191
|
+
lines[x].originalPoints = lineReader.getOriginalPointsById(lines[x].id);
|
|
5206
5192
|
lines[x].originalPoints.forEach((item) => {
|
|
5207
5193
|
if (item.z > doorTmpSt.z + 0.2 && item.z < doorTmpSt.z + height / 2)
|
|
5208
5194
|
allTmpPoints.push(new THREE5.Vector3(item.x, item.y, doorTmpSt.z));
|
|
@@ -5560,9 +5546,9 @@ var getColLine = (lines, runDataList) => {
|
|
|
5560
5546
|
};
|
|
5561
5547
|
let isFindColIndexs = /* @__PURE__ */ new Set();
|
|
5562
5548
|
let minColLineLength = 0.1;
|
|
5563
|
-
let maxColLineLength =
|
|
5549
|
+
let maxColLineLength = 2;
|
|
5564
5550
|
let minArea = 0.15;
|
|
5565
|
-
let maxArea = 2;
|
|
5551
|
+
let maxArea = 2.5;
|
|
5566
5552
|
let minPerpendicularAngle = 80;
|
|
5567
5553
|
let maxPerpendicularAngle = 95;
|
|
5568
5554
|
if (!lines[0].uuid) {
|
|
@@ -5590,6 +5576,7 @@ var getColLine = (lines, runDataList) => {
|
|
|
5590
5576
|
if (result[i].uuids.length < 4 || result[i].area < minArea || result[i].area > maxArea)
|
|
5591
5577
|
continue;
|
|
5592
5578
|
let isRect = false;
|
|
5579
|
+
let overlapWallLines = [];
|
|
5593
5580
|
for (let j = 0; j < result[i].lineIndexes.length; j++) {
|
|
5594
5581
|
let length1 = lines[result[i].lineIndexes[j]].length;
|
|
5595
5582
|
if (length1 < minColLineLength || length1 > maxColLineLength)
|
|
@@ -8766,10 +8753,6 @@ var getMergeMeaning = (allProjectionResults, averagePz2, pointCloudCluster = nul
|
|
|
8766
8753
|
const f1 = calculateClosePointWithOBB(array2[k].points, obb1);
|
|
8767
8754
|
const f2 = calculateClosePointWithOBB(array1[e].points, obb2);
|
|
8768
8755
|
const isMaxBox = compareBoxVolume(obb1, obb2);
|
|
8769
|
-
if (f2 >= 0.5 && isMaxBox == -1 && type1 !== "Staircase" && type2 !== "Staircase") {
|
|
8770
|
-
array1[e].isDel = true;
|
|
8771
|
-
break;
|
|
8772
|
-
}
|
|
8773
8756
|
if (type1 !== "wall" && type1 !== "floor" && type1 !== "roof") {
|
|
8774
8757
|
if (type1 === "window") {
|
|
8775
8758
|
if (type2 === "balcony railing" && containsObbPoints(obb1, array2[k].points)) {
|
|
@@ -8820,19 +8803,47 @@ var getMergeMeaning = (allProjectionResults, averagePz2, pointCloudCluster = nul
|
|
|
8820
8803
|
break;
|
|
8821
8804
|
}
|
|
8822
8805
|
} else if (type1 === "door") {
|
|
8823
|
-
if (type2 === "window"
|
|
8824
|
-
|
|
8825
|
-
|
|
8806
|
+
if (type2 === "window") {
|
|
8807
|
+
if (type2 === "window" && containsObbPoints(obb1, array2[k].points)) {
|
|
8808
|
+
array1[e].isDel = true;
|
|
8809
|
+
break;
|
|
8810
|
+
}
|
|
8811
|
+
if (type2 === "window" && containsObbPoints(obb2, array1[e].points)) {
|
|
8812
|
+
array1[e].isDel = true;
|
|
8813
|
+
break;
|
|
8814
|
+
}
|
|
8815
|
+
if (type2 === "window sill" && containsObbPoints(obb1, array2[k].points)) {
|
|
8816
|
+
array1[e].isDel = true;
|
|
8817
|
+
break;
|
|
8818
|
+
}
|
|
8819
|
+
if (type2 === "window sill" && containsObbPoints(obb2, array1[e].points)) {
|
|
8820
|
+
array1[e].isDel = true;
|
|
8821
|
+
break;
|
|
8822
|
+
}
|
|
8823
|
+
} else {
|
|
8824
|
+
if (containsObbPoints(obb1, array2[k].points)) {
|
|
8825
|
+
array2[k].isDel = true;
|
|
8826
|
+
continue;
|
|
8827
|
+
}
|
|
8828
|
+
if (containsObbPoints(obb2, array1[e].points)) {
|
|
8829
|
+
array2[k].isDel = true;
|
|
8830
|
+
continue;
|
|
8831
|
+
}
|
|
8832
|
+
if (obb1.intersectsOBB(obb2)) {
|
|
8833
|
+
array2[k].isDel = true;
|
|
8834
|
+
continue;
|
|
8835
|
+
}
|
|
8826
8836
|
}
|
|
8827
|
-
|
|
8837
|
+
} else if (type2 === "door") {
|
|
8838
|
+
if (containsObbPoints(obb1, array2[k].points)) {
|
|
8828
8839
|
array1[e].isDel = true;
|
|
8829
8840
|
break;
|
|
8830
8841
|
}
|
|
8831
|
-
if (
|
|
8842
|
+
if (containsObbPoints(obb2, array1[e].points)) {
|
|
8832
8843
|
array1[e].isDel = true;
|
|
8833
8844
|
break;
|
|
8834
8845
|
}
|
|
8835
|
-
if (
|
|
8846
|
+
if (obb1.intersectsOBB(obb2)) {
|
|
8836
8847
|
array1[e].isDel = true;
|
|
8837
8848
|
break;
|
|
8838
8849
|
}
|
|
@@ -9061,6 +9072,7 @@ var getMergeMeaning = (allProjectionResults, averagePz2, pointCloudCluster = nul
|
|
|
9061
9072
|
}
|
|
9062
9073
|
}
|
|
9063
9074
|
}
|
|
9075
|
+
return pcdPointsArr;
|
|
9064
9076
|
const retPcdPointArr = [];
|
|
9065
9077
|
for (let i = 0; i < pcdPointsArr.length; i++) {
|
|
9066
9078
|
const array = pcdPointsArr[i].array;
|