rm-graphical-computing-node 1.0.145 → 1.0.146

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 +30 -22
  2. package/package.json +1 -1
package/dist/index.mjs CHANGED
@@ -15918,38 +15918,42 @@ var checkWindowAndDoorIsTrue2 = async (lines, runDataList, collectDataPath, dir,
15918
15918
  const windowLines = [];
15919
15919
  for (let i = 0; i < lines.length; i++) {
15920
15920
  const line2 = lines[i];
15921
- if (line2.drawWindow && line2.drawWindow.length || line2.drawDoorData && line2.drawDoorData.start) {
15921
+ if (line2.drawWindow && line2.drawWindow.length) {
15922
15922
  line2.saveExistSegments = true;
15923
15923
  getOneLineCheckResults(line2, false);
15924
- let indexs = /* @__PURE__ */ new Set();
15925
15924
  const drawWindow = line2.drawWindow || [];
15926
15925
  const direction = getPt3(line2.direction).normalize();
15927
- let checkResults = { allCenterPoints: [], originalVertices: [] };
15926
+ let checkResults = [];
15928
15927
  for (let j = 0; j < drawWindow.length; j++) {
15929
15928
  let p = getPt3(drawWindow[j].p);
15930
15929
  let st = p.clone().addScaledVector(direction, drawWindow[j].width / 2);
15931
15930
  let ed = p.clone().addScaledVector(direction, -drawWindow[j].width / 2);
15932
15931
  st.z = ed.z = 0;
15933
15932
  let Line36 = new THREE10.Line3(st, ed);
15934
- const allCenterPoints = line2.existSegments.allCenterPoints;
15935
- let minZ = p.z + drawWindow[j].groundClearance;
15936
- let maxZ = p.z + drawWindow[j].groundClearance + drawWindow[j].height;
15937
- for (let k = 0; k < allCenterPoints.length; k++) {
15938
- if (indexs.has(k))
15939
- continue;
15940
- let cp = getPt3(allCenterPoints[k]);
15941
- let originZ = cp.z;
15942
- cp.z = 0;
15943
- let isOnLine = isPointOnLine(Line36, cp, 1e-3);
15944
- if (isOnLine && originZ >= minZ && originZ <= maxZ) {
15945
- indexs.add(k);
15933
+ for (let g = 0; g < line2.existSegments.length; g++) {
15934
+ const allCenterPoints = line2.existSegments[g].allCenterPoints;
15935
+ let minZ = p.z + drawWindow[j].groundClearance;
15936
+ let maxZ = p.z + drawWindow[j].groundClearance + drawWindow[j].height;
15937
+ let indexs = /* @__PURE__ */ new Set();
15938
+ for (let k = 0; k < allCenterPoints.length; k++) {
15939
+ if (indexs.has(k))
15940
+ continue;
15941
+ let cp = getPt3(allCenterPoints[k]);
15942
+ let originZ = cp.z;
15943
+ cp.z = 0;
15944
+ let isOnLine = isPointOnLine(Line36, cp, 1e-3);
15945
+ if (isOnLine && originZ >= minZ && originZ <= maxZ) {
15946
+ indexs.add(k);
15947
+ }
15946
15948
  }
15949
+ let checkResult = { allCenterPoints: [], originalVertices: [] };
15950
+ for (const idx of indexs) {
15951
+ checkResult.allCenterPoints.push(line2.existSegments[g].allCenterPoints[idx]);
15952
+ checkResult.originalVertices.push(line2.existSegments[g].originalVertices[idx]);
15953
+ }
15954
+ checkResults.push(checkResult);
15947
15955
  }
15948
15956
  }
15949
- for (const idx of indexs) {
15950
- checkResults.allCenterPoints.push(line2.existSegments.allCenterPoints[idx]);
15951
- checkResults.originalVertices.push(line2.existSegments.originalVertices[idx]);
15952
- }
15953
15957
  line2.checkResults = checkResults;
15954
15958
  windowLines.push(line2);
15955
15959
  }
@@ -15957,12 +15961,16 @@ var checkWindowAndDoorIsTrue2 = async (lines, runDataList, collectDataPath, dir,
15957
15961
  let trajectoryObj = {};
15958
15962
  for (let r = 0; r < runDataList.length; r++) {
15959
15963
  trajectoryObj[r] = runDataList[r];
15964
+ trajectoryObj[r].qx = 0;
15965
+ trajectoryObj[r].qy = 0;
15966
+ trajectoryObj[r].qz = 0;
15967
+ trajectoryObj[r].qw = 0;
15960
15968
  }
15961
- await penetratingTask(windowLines, trajectoryObj, collectDataPath, 1, "normal", 0.01, dir);
15969
+ await penetratingTask(windowLines, trajectoryObj, collectDataPath, 0.5, "normal", 0.01, dir);
15962
15970
  for (let i = 0; i < windowLines.length; i++) {
15963
15971
  let len = 0;
15964
15972
  for (let u4 = 0; u4 < windowLines[i].checkResults.length; u4++)
15965
- len = windowLines[i].checkResults[u4].allCenterPoints.length;
15973
+ len += windowLines[i].checkResults[u4].allCenterPoints.length;
15966
15974
  const allCenterPoints = windowLines[i].allCenterPoints;
15967
15975
  if (!allCenterPoints || !allCenterPoints.length)
15968
15976
  continue;
@@ -15990,7 +15998,7 @@ var checkWindowAndDoorIsTrue2 = async (lines, runDataList, collectDataPath, dir,
15990
15998
  newPoints = allCenterPoints;
15991
15999
  let retNum = newPoints.length;
15992
16000
  let ps = retNum / len * 100;
15993
- if (ps < 60) {
16001
+ if (ps < 80) {
15994
16002
  windowLines[i].isRebuild = true;
15995
16003
  }
15996
16004
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rm-graphical-computing-node",
3
- "version": "1.0.145",
3
+ "version": "1.0.146",
4
4
  "description": "墙体/梁线/点云语义计算库(依赖 Python 与 three.js)",
5
5
  "type": "module",
6
6
  "main": "dist/index.mjs",