rm-graphical-computing-node 1.0.93 → 1.0.95
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 +54 -24
- package/package.json +1 -2
package/dist/index.mjs
CHANGED
|
@@ -9268,6 +9268,9 @@ var getMergeMeaning = (allProjectionResults, averagePz2, pointCloudCluster = nul
|
|
|
9268
9268
|
if (type2 === "window sill" && containsObbPoints(obb2, array1[e].points)) {
|
|
9269
9269
|
continue;
|
|
9270
9270
|
}
|
|
9271
|
+
if (type2 === "window sill" && obb1.intersectsOBB(obb2)) {
|
|
9272
|
+
continue;
|
|
9273
|
+
}
|
|
9271
9274
|
} else if (type1 === "door") {
|
|
9272
9275
|
if (type2 === "window") {
|
|
9273
9276
|
if (type2 === "window" && containsObbPoints(obb1, array2[k].points)) {
|
|
@@ -9300,19 +9303,6 @@ var getMergeMeaning = (allProjectionResults, averagePz2, pointCloudCluster = nul
|
|
|
9300
9303
|
continue;
|
|
9301
9304
|
}
|
|
9302
9305
|
}
|
|
9303
|
-
} else if (type2 === "door") {
|
|
9304
|
-
if (containsObbPoints(obb1, array2[k].points)) {
|
|
9305
|
-
array1[e].isDel = true;
|
|
9306
|
-
break;
|
|
9307
|
-
}
|
|
9308
|
-
if (containsObbPoints(obb2, array1[e].points)) {
|
|
9309
|
-
array1[e].isDel = true;
|
|
9310
|
-
break;
|
|
9311
|
-
}
|
|
9312
|
-
if (obb1.intersectsOBB(obb2)) {
|
|
9313
|
-
array1[e].isDel = true;
|
|
9314
|
-
break;
|
|
9315
|
-
}
|
|
9316
9306
|
} else if (type1 === "window sill") {
|
|
9317
9307
|
if (type2 === "window")
|
|
9318
9308
|
continue;
|
|
@@ -9334,6 +9324,9 @@ var getMergeMeaning = (allProjectionResults, averagePz2, pointCloudCluster = nul
|
|
|
9334
9324
|
if (type2 === "balcony railing" && containsObbPoints(obb2, array1[e].points)) {
|
|
9335
9325
|
continue;
|
|
9336
9326
|
}
|
|
9327
|
+
if (type2 === "balcony railing" && obb1.intersectsOBB(obb2)) {
|
|
9328
|
+
continue;
|
|
9329
|
+
}
|
|
9337
9330
|
if (type2 === "pipe" && containsObbPoints(obb1, array2[k].points)) {
|
|
9338
9331
|
continue;
|
|
9339
9332
|
}
|
|
@@ -9363,6 +9356,19 @@ var getMergeMeaning = (allProjectionResults, averagePz2, pointCloudCluster = nul
|
|
|
9363
9356
|
if (type2 === "window sill" && obb1.intersectsOBB(obb2)) {
|
|
9364
9357
|
continue;
|
|
9365
9358
|
}
|
|
9359
|
+
} else if (type2 === "door") {
|
|
9360
|
+
if (containsObbPoints(obb1, array2[k].points)) {
|
|
9361
|
+
array1[e].isDel = true;
|
|
9362
|
+
break;
|
|
9363
|
+
}
|
|
9364
|
+
if (containsObbPoints(obb2, array1[e].points)) {
|
|
9365
|
+
array1[e].isDel = true;
|
|
9366
|
+
break;
|
|
9367
|
+
}
|
|
9368
|
+
if (obb1.intersectsOBB(obb2)) {
|
|
9369
|
+
array1[e].isDel = true;
|
|
9370
|
+
break;
|
|
9371
|
+
}
|
|
9366
9372
|
}
|
|
9367
9373
|
let isMax = false;
|
|
9368
9374
|
let majorPoints = [];
|
|
@@ -11724,7 +11730,7 @@ var getWindowData = (lines, pcdData, lineReader) => {
|
|
|
11724
11730
|
for (let i = 0; i < pcdData.length; i++) {
|
|
11725
11731
|
const window = pcdData[i];
|
|
11726
11732
|
window.isFindWindow = false;
|
|
11727
|
-
if (window.category == "window" && !window.isBayWindowObj) {
|
|
11733
|
+
if (window.category == "window" && !window.isBayWindowObj && !window.isFilterWindow) {
|
|
11728
11734
|
let boxPoints = [];
|
|
11729
11735
|
window.coordinatesByArea.coordinates.forEach((p) => {
|
|
11730
11736
|
boxPoints.push(new THREE10.Vector3(p.x, p.y, p.z));
|
|
@@ -11752,7 +11758,8 @@ var getWindowData = (lines, pcdData, lineReader) => {
|
|
|
11752
11758
|
inWall: false,
|
|
11753
11759
|
//是否在墙内
|
|
11754
11760
|
name: window.name,
|
|
11755
|
-
rectPts: window.coordinatesByArea.coordinates
|
|
11761
|
+
rectPts: window.coordinatesByArea.coordinates,
|
|
11762
|
+
obj_id: window.obj_id
|
|
11756
11763
|
});
|
|
11757
11764
|
}
|
|
11758
11765
|
}
|
|
@@ -11863,6 +11870,7 @@ var getWindowData = (lines, pcdData, lineReader) => {
|
|
|
11863
11870
|
continue;
|
|
11864
11871
|
let addData = false;
|
|
11865
11872
|
let isWindow = false;
|
|
11873
|
+
let windowObj_id = "";
|
|
11866
11874
|
let beforePcdDoorisFindWindow = false;
|
|
11867
11875
|
let doorOpenVector = new THREE10.Vector3(0, 0, 0);
|
|
11868
11876
|
let pcbDoorIndexs = [];
|
|
@@ -11922,6 +11930,7 @@ var getWindowData = (lines, pcdData, lineReader) => {
|
|
|
11922
11930
|
isWindow = true;
|
|
11923
11931
|
pcbDoorIndexs.push(windowDatas[n].index);
|
|
11924
11932
|
windowDatas[n].isFind = true;
|
|
11933
|
+
windowObj_id = windowDatas[n].obj_id;
|
|
11925
11934
|
findDoorDataIndex = n;
|
|
11926
11935
|
beforePcdDoorisFindWindow = pcdData[windowDatas[n].index].isFindWindow;
|
|
11927
11936
|
pcdData[windowDatas[n].index].isFindWindow = true;
|
|
@@ -11954,6 +11963,7 @@ var getWindowData = (lines, pcdData, lineReader) => {
|
|
|
11954
11963
|
beforePcdDoorisFindWindow = pcdData[windowDatas[n].index].isFindWindow;
|
|
11955
11964
|
pcdData[windowDatas[n].index].isFindWindow = true;
|
|
11956
11965
|
findDoorDataIndex = n;
|
|
11966
|
+
windowObj_id = windowDatas[n].obj_id;
|
|
11957
11967
|
}
|
|
11958
11968
|
}
|
|
11959
11969
|
}
|
|
@@ -11990,6 +12000,7 @@ var getWindowData = (lines, pcdData, lineReader) => {
|
|
|
11990
12000
|
isWindow = true;
|
|
11991
12001
|
windowDatas[n].isFind = true;
|
|
11992
12002
|
findDoorDataIndex = n;
|
|
12003
|
+
windowObj_id = windowDatas[n].obj_id;
|
|
11993
12004
|
}
|
|
11994
12005
|
}
|
|
11995
12006
|
}
|
|
@@ -12225,7 +12236,8 @@ var getWindowData = (lines, pcdData, lineReader) => {
|
|
|
12225
12236
|
type: "window",
|
|
12226
12237
|
isWindow,
|
|
12227
12238
|
pcbDoorIndexs,
|
|
12228
|
-
groundClearance
|
|
12239
|
+
groundClearance,
|
|
12240
|
+
obj_id: windowObj_id
|
|
12229
12241
|
};
|
|
12230
12242
|
line2.windowIdToCheckResults.push([region.index, id]);
|
|
12231
12243
|
line2.windowData.push(doorAndBeamDataObj);
|
|
@@ -12368,7 +12380,7 @@ var getWindowPcdData = (lines, pcdData) => {
|
|
|
12368
12380
|
const pcdToLineDist = 0.3;
|
|
12369
12381
|
for (let i = 0; i < pcdData.length; i++) {
|
|
12370
12382
|
const pcd = pcdData[i];
|
|
12371
|
-
if (pcd.category != "window" || pcd.isBayWindowObj || pcd.isFindWindow)
|
|
12383
|
+
if (pcd.category != "window" || pcd.isBayWindowObj || pcd.isFindWindow || pcd.isFilterWindow)
|
|
12372
12384
|
continue;
|
|
12373
12385
|
let ptArray = pcd.coordinatesByArea.coordinates;
|
|
12374
12386
|
let minZ = pcd.coordinatesByArea.heightData.minZ;
|
|
@@ -12457,8 +12469,23 @@ var getWindowPcdData = (lines, pcdData) => {
|
|
|
12457
12469
|
let ptStart = getPt3(line2.start);
|
|
12458
12470
|
let ptEnd = getPt3(line2.end);
|
|
12459
12471
|
ptStart.z = ptEnd.z = ptShortEd1.z;
|
|
12460
|
-
let
|
|
12461
|
-
let
|
|
12472
|
+
let tmpptStart = ptStart.clone();
|
|
12473
|
+
let tmpptEnd = ptEnd.clone();
|
|
12474
|
+
let tmpptShortSt1 = ptShortSt1.clone();
|
|
12475
|
+
let tmpptShortEd1 = ptShortEd1.clone();
|
|
12476
|
+
let tmpptShortSt2 = ptShortSt2.clone();
|
|
12477
|
+
let tmpptShortEd2 = ptShortEd2.clone();
|
|
12478
|
+
let vec1 = getVector3(tmpptShortSt1, tmpptShortEd1);
|
|
12479
|
+
let vec2 = getVector3(tmpptShortSt2, tmpptShortEd2);
|
|
12480
|
+
let vec32 = getVector3(tmpptStart, tmpptEnd);
|
|
12481
|
+
tmpptStart = tmpptStart.addScaledVector(vec32, -0.1);
|
|
12482
|
+
tmpptEnd = tmpptEnd.addScaledVector(vec32, 0.1);
|
|
12483
|
+
tmpptShortSt1 = tmpptShortSt1.addScaledVector(vec1, -0.1);
|
|
12484
|
+
tmpptShortEd1 = tmpptShortEd1.addScaledVector(vec1, 0.1);
|
|
12485
|
+
tmpptShortSt2 = tmpptShortSt2.addScaledVector(vec2, -0.1);
|
|
12486
|
+
tmpptShortEd2 = tmpptShortEd2.addScaledVector(vec2, 0.1);
|
|
12487
|
+
let intersect1 = segmentsIntersect2D(tmpptStart, tmpptEnd, tmpptShortSt1, tmpptShortEd1, pcdToLineDist);
|
|
12488
|
+
let intersect2 = segmentsIntersect2D(tmpptStart, tmpptEnd, tmpptShortSt2, tmpptShortEd2, pcdToLineDist);
|
|
12462
12489
|
if (intersect1 != null && intersect2 != null) {
|
|
12463
12490
|
if (line2.mergeIndexs) {
|
|
12464
12491
|
let tmpIndex = [];
|
|
@@ -12486,7 +12513,8 @@ var getWindowPcdData = (lines, pcdData) => {
|
|
|
12486
12513
|
full: false,
|
|
12487
12514
|
groundClearance,
|
|
12488
12515
|
height,
|
|
12489
|
-
width: ptWindowSt.distanceTo(ptWindowEd)
|
|
12516
|
+
width: ptWindowSt.distanceTo(ptWindowEd),
|
|
12517
|
+
pcd_id: pcd.obj_id
|
|
12490
12518
|
});
|
|
12491
12519
|
line2.isWindow = true;
|
|
12492
12520
|
pcd.isWindowDoor = true;
|
|
@@ -12513,9 +12541,9 @@ var getWindowPcdData = (lines, pcdData) => {
|
|
|
12513
12541
|
}
|
|
12514
12542
|
let line3 = new THREE10.Line3(ptStart, ptEnd);
|
|
12515
12543
|
let ptClose = line3.closestPointToPoint(pcdMid, false, new THREE10.Vector3());
|
|
12516
|
-
let
|
|
12544
|
+
let vec4 = getVector3(ptWindowSt, ptClose);
|
|
12517
12545
|
let width = ptMid1.distanceTo(ptMid2);
|
|
12518
|
-
let ptWindowEd = ptWindowSt.clone().addScaledVector(
|
|
12546
|
+
let ptWindowEd = ptWindowSt.clone().addScaledVector(vec4, width);
|
|
12519
12547
|
let groundClearance = minZ - line2.start.z;
|
|
12520
12548
|
groundClearance = groundClearance > 0.01 ? groundClearance : 0;
|
|
12521
12549
|
if (!line2.drawWindow)
|
|
@@ -12527,7 +12555,8 @@ var getWindowPcdData = (lines, pcdData) => {
|
|
|
12527
12555
|
full: false,
|
|
12528
12556
|
groundClearance,
|
|
12529
12557
|
height,
|
|
12530
|
-
width: ptWindowSt.distanceTo(ptWindowEd)
|
|
12558
|
+
width: ptWindowSt.distanceTo(ptWindowEd),
|
|
12559
|
+
pcd_id: pcd.obj_id
|
|
12531
12560
|
});
|
|
12532
12561
|
line2.isWindow = true;
|
|
12533
12562
|
pcd.isWindowDoor = true;
|
|
@@ -12573,7 +12602,8 @@ var getWindowPcdData = (lines, pcdData) => {
|
|
|
12573
12602
|
full: false,
|
|
12574
12603
|
groundClearance,
|
|
12575
12604
|
height,
|
|
12576
|
-
width: ptWindowSt.distanceTo(ptWindowEd)
|
|
12605
|
+
width: ptWindowSt.distanceTo(ptWindowEd),
|
|
12606
|
+
pcd_id: pcd.obj_id
|
|
12577
12607
|
});
|
|
12578
12608
|
line2.isWindow = true;
|
|
12579
12609
|
pcd.isWindowDoor = true;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "rm-graphical-computing-node",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.95",
|
|
4
4
|
"description": "墙体/梁线/点云语义计算库(依赖 Python 与 three.js)",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.mjs",
|
|
@@ -22,7 +22,6 @@
|
|
|
22
22
|
"geojson-minimum-bounding-rectangle": "^2.0.3",
|
|
23
23
|
"rm-gxf-computing-rusts": "^0.0.61",
|
|
24
24
|
"rm-point-cloud-calculation": "^1.0.4",
|
|
25
|
-
"rm-point-cloud-calculation-napi": "^1.0.15",
|
|
26
25
|
"three": "^0.184.0"
|
|
27
26
|
},
|
|
28
27
|
"devDependencies": {
|