build-dxf 0.1.83 → 0.1.84

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "build-dxf",
3
- "version": "0.1.83",
3
+ "version": "0.1.84",
4
4
  "description": "线段构建双线墙壁的dxf版本",
5
5
  "main": "./src/index.js",
6
6
  "types": "./src/index.d.ts",
package/src/build.js CHANGED
@@ -10066,8 +10066,8 @@ class Scenario {
10066
10066
  new THREE.LineBasicMaterial({
10067
10067
  color: 65280
10068
10068
  });
10069
- const MobileX = this.angleToXAxisDegrees(data.start.x, data.start.y, data.end.x, data.end.y, DEFAULT_WALL_HALF_WIDTH, true);
10070
- const MobileY = this.angleToXAxisDegrees(data.start.x, data.start.y, data.end.x, data.end.y, DEFAULT_WALL_HALF_WIDTH, false);
10069
+ const MobileX = this.angleToXAxisDegrees(data.start.x, data.start.y, data.end.x, data.end.y, DEFAULT_WALL_HALF_WIDTH + 0.01, true);
10070
+ const MobileY = this.angleToXAxisDegrees(data.start.x, data.start.y, data.end.x, data.end.y, DEFAULT_WALL_HALF_WIDTH + 0.01, false);
10071
10071
  let startingPoint = this.xinLine(MobileX, MobileY, data.start, 0);
10072
10072
  let finishLine = this.xinLine(MobileX, MobileY, data.end, 1);
10073
10073
  const grid = createPointVirtualGrid(this.lines);
@@ -10217,13 +10217,17 @@ class Scenario {
10217
10217
  // 窗的处理
10218
10218
  windowTreatment(dblWin, mesh, wallHeight) {
10219
10219
  const doorList = dblWin;
10220
- const MobileX = this.angleToXAxisDegrees(doorList.start.x, doorList.start.y, doorList.end.x, doorList.end.y, doorList.userData.wallWidth ? doorList.userData.wallWidth : 0.5, true);
10221
- const MobileY = this.angleToXAxisDegrees(doorList.start.x, doorList.start.y, doorList.end.x, doorList.end.y, doorList.userData.wallWidth ? doorList.userData.wallWidth : 0.5, false);
10220
+ const MobileX = this.angleToXAxisDegrees(doorList.start.x, doorList.start.y, doorList.end.x, doorList.end.y, doorList.userData.wallWidth ? doorList.userData.wallWidth + 1e-3 : 0.5, true);
10221
+ const MobileY = this.angleToXAxisDegrees(doorList.start.x, doorList.start.y, doorList.end.x, doorList.end.y, doorList.userData.wallWidth ? doorList.userData.wallWidth + 1e-3 : 0.5, false);
10222
10222
  let startingPoint = this.xinLine(MobileX, MobileY, doorList.start, wallHeight);
10223
10223
  let finishLine = this.xinLine(MobileX, MobileY, doorList.end, wallHeight);
10224
- startingPoint.push(finishLine[1]);
10225
- startingPoint.push(finishLine[0]);
10226
- return this.winHoleOpening(startingPoint, mesh, dblWin.userData.groundClearance, dblWin.userData.height);
10224
+ let x = MobileX > 0 ? 3e-3 : -3e-3;
10225
+ let y = MobileY > 0 ? 3e-3 : -3e-3;
10226
+ let startingPoint1 = this.xinLine1(y, x, startingPoint[0], startingPoint[1], 0, wallHeight);
10227
+ let finishLine1 = this.xinLine1(y, x, finishLine[0], finishLine[1], 1, wallHeight);
10228
+ startingPoint1.push(finishLine1[1]);
10229
+ startingPoint1.push(finishLine1[0]);
10230
+ return this.winHoleOpening(startingPoint1, mesh, dblWin.userData.groundClearance, dblWin.userData.height);
10227
10231
  }
10228
10232
  windowTreatment1(dblWin, mesh, wallHeight) {
10229
10233
  const doorList = dblWin;
@@ -10239,8 +10243,8 @@ class Scenario {
10239
10243
  TheHandlingOfTheDoor1(data) {
10240
10244
  const wallHeightc = data.userData.height ? data.userData.height : this.wallHeight;
10241
10245
  const doorList = data;
10242
- const MobileX = this.angleToXAxisDegrees(doorList.start.x, doorList.start.y, doorList.end.x, doorList.end.y, DEFAULT_WALL_HALF_WIDTH, true);
10243
- const MobileY = this.angleToXAxisDegrees(doorList.start.x, doorList.start.y, doorList.end.x, doorList.end.y, DEFAULT_WALL_HALF_WIDTH, false);
10246
+ const MobileX = this.angleToXAxisDegrees(doorList.start.x, doorList.start.y, doorList.end.x, doorList.end.y, DEFAULT_WALL_HALF_WIDTH + 0.01, true);
10247
+ const MobileY = this.angleToXAxisDegrees(doorList.start.x, doorList.start.y, doorList.end.x, doorList.end.y, DEFAULT_WALL_HALF_WIDTH + 0.01, false);
10244
10248
  let startingPoint = this.xinLine(MobileX, MobileY, doorList.start, doorList.userData.height ? doorList.userData.height : this.wallHeight);
10245
10249
  let finishLine = this.xinLine(MobileX, MobileY, doorList.end, doorList.userData.height ? doorList.userData.height : this.wallHeight);
10246
10250
  const quadtree = createQuadtree(this.lines);
@@ -10288,8 +10292,8 @@ class Scenario {
10288
10292
  const dy = point2.y - point1.y;
10289
10293
  const angleRad = Math.atan2(dy, dx);
10290
10294
  const distance2 = point1.distanceTo(point2);
10291
- const MobileX = this.angleToXAxisDegrees(doorList[i].start.x, doorList[i].start.y, doorList[i].end.x, doorList[i].end.y, DEFAULT_WALL_HALF_WIDTH, true);
10292
- const MobileY = this.angleToXAxisDegrees(doorList[i].start.x, doorList[i].start.y, doorList[i].end.x, doorList[i].end.y, DEFAULT_WALL_HALF_WIDTH, false);
10295
+ const MobileX = this.angleToXAxisDegrees(doorList[i].start.x, doorList[i].start.y, doorList[i].end.x, doorList[i].end.y, DEFAULT_WALL_HALF_WIDTH + 0.01, true);
10296
+ const MobileY = this.angleToXAxisDegrees(doorList[i].start.x, doorList[i].start.y, doorList[i].end.x, doorList[i].end.y, DEFAULT_WALL_HALF_WIDTH + 0.01, false);
10293
10297
  let startingPoint = this.xinLine(MobileX, MobileY, doorList[i].start, doorList[i].userData.height ? doorList[i].userData.height : this.wallHeight);
10294
10298
  let finishLine = this.xinLine(MobileX, MobileY, doorList[i].end, doorList[i].userData.height ? doorList[i].userData.height : this.wallHeight);
10295
10299
  const quadtree = createQuadtree(this.lines);
@@ -10647,12 +10651,14 @@ class Scenario {
10647
10651
  xinLine1(x, y, pointa, pointb, num, wallHeight) {
10648
10652
  let point1;
10649
10653
  let point2;
10654
+ let xx = x > 0 ? x + -1e-3 : 1e-3;
10655
+ let yy = y > 0 ? y + -1e-3 : 1e-3;
10650
10656
  if (num === 0) {
10651
- point1 = new THREE.Vector3(pointa.x - x, pointa.y - y, wallHeight);
10652
- point2 = new THREE.Vector3(pointb.x - x, pointb.y - y, wallHeight);
10657
+ point1 = new THREE.Vector3(pointa.x - xx, pointa.y - yy, wallHeight);
10658
+ point2 = new THREE.Vector3(pointb.x - xx, pointb.y - yy, wallHeight);
10653
10659
  } else {
10654
- point1 = new THREE.Vector3(pointa.x + x, pointa.y + y, wallHeight);
10655
- point2 = new THREE.Vector3(pointb.x + x, pointb.y + y, wallHeight);
10660
+ point1 = new THREE.Vector3(pointa.x + xx, pointa.y + yy, wallHeight);
10661
+ point2 = new THREE.Vector3(pointb.x + xx, pointb.y + yy, wallHeight);
10656
10662
  }
10657
10663
  return [point1, point2];
10658
10664
  }
@@ -1,9 +1,9 @@
1
1
  import { LineSegment } from '../../../../algorithmsStructures/LineSegment';
2
- import { SetDataOption } from '../../../type';
2
+ import { LineUserData, SetDataOption } from '../../../type';
3
3
  /** 轴对齐垂直纠正
4
4
  * @param lines
5
5
  * @param option
6
6
  * @param verticalReferenceLine
7
7
  * @returns
8
8
  */
9
- export declare function axisAlignCorr(lines: LineSegment[], option: SetDataOption, verticalReferenceLine?: LineSegment): LineSegment<any>[];
9
+ export declare function axisAlignCorr(lines: LineSegment<LineUserData>[], option: SetDataOption, verticalReferenceLine?: LineSegment): LineSegment<any>[];