build-dxf 0.0.62 → 0.0.63

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/package.json +1 -1
  2. package/src/build.js +19 -17
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "build-dxf",
3
- "version": "0.0.62",
3
+ "version": "0.0.63",
4
4
  "description": "线段构建双线墙壁的dxf版本",
5
5
  "main": "./src/index.js",
6
6
  "types": "./src/index.d.ts",
package/src/build.js CHANGED
@@ -13228,7 +13228,7 @@ class Scenario {
13228
13228
  const distance = point1.distanceTo(point2);
13229
13229
  const height = data.userData.height ? data.userData.height : this.WindowHeight;
13230
13230
  const wallWidth = data.userData.wallWidth ? data.userData.wallWidth : 0.18;
13231
- const groundClearance = data.userData.groundClearance ? data.userData.groundClearance : this.WindowGroundHeight;
13231
+ const groundClearance = (data.userData.groundClearance ?? this.WindowGroundHeight) + this.height;
13232
13232
  let menModel = this.windowModely.clone();
13233
13233
  if (data.center && distance) {
13234
13234
  menModel.position.set(data.center.x, data.center.y, 0);
@@ -13283,12 +13283,13 @@ class Scenario {
13283
13283
  }
13284
13284
  // 窗扣洞
13285
13285
  winHoleOpening(data, mesh, winGroundHeight, Height) {
13286
+ winGroundHeight = (winGroundHeight ?? this.WindowGroundHeight) + this.height;
13286
13287
  const basePoints = [
13287
- new THREE.Vector3(data[0].x, data[0].y, winGroundHeight ? winGroundHeight : this.WindowGroundHeight),
13288
- new THREE.Vector3(data[1].x, data[1].y, winGroundHeight ? winGroundHeight : this.WindowGroundHeight),
13289
- new THREE.Vector3(data[2].x, data[2].y, winGroundHeight ? winGroundHeight : this.WindowGroundHeight),
13288
+ new THREE.Vector3(data[0].x, data[0].y, winGroundHeight),
13289
+ new THREE.Vector3(data[1].x, data[1].y, winGroundHeight),
13290
+ new THREE.Vector3(data[2].x, data[2].y, winGroundHeight),
13290
13291
  // 可以不是矩形
13291
- new THREE.Vector3(data[3].x, data[3].y, winGroundHeight ? winGroundHeight : this.WindowGroundHeight)
13292
+ new THREE.Vector3(data[3].x, data[3].y, winGroundHeight)
13292
13293
  ];
13293
13294
  const geometry = this.createParallelepipedFromBase(basePoints, Height ? Height : this.WindowHeight);
13294
13295
  const material = new THREE.MeshStandardMaterial({
@@ -13313,26 +13314,27 @@ class Scenario {
13313
13314
  }
13314
13315
  // 门扣洞
13315
13316
  doorHoleOpening(data, data1, groundHeight, Height, distance, center, angleRad, index2) {
13317
+ groundHeight = (groundHeight ?? this.doorGroundHeight) + this.height;
13316
13318
  const basePoints = [
13317
- new THREE.Vector3(data[0].x, data[0].y, groundHeight ? groundHeight : this.doorGroundHeight),
13318
- new THREE.Vector3(data[1].x, data[1].y, groundHeight ? groundHeight : this.doorGroundHeight),
13319
- new THREE.Vector3(data[2].x, data[2].y, groundHeight ? groundHeight : this.doorGroundHeight),
13319
+ new THREE.Vector3(data[0].x, data[0].y, groundHeight),
13320
+ new THREE.Vector3(data[1].x, data[1].y, groundHeight),
13321
+ new THREE.Vector3(data[2].x, data[2].y, groundHeight),
13320
13322
  // 可以不是矩形
13321
- new THREE.Vector3(data[3].x, data[3].y, groundHeight ? groundHeight : this.doorGroundHeight)
13323
+ new THREE.Vector3(data[3].x, data[3].y, groundHeight)
13322
13324
  ];
13323
13325
  const basePoints1 = [
13324
- new THREE.Vector3(data1[0].x, data1[0].y, groundHeight ? groundHeight : this.doorGroundHeight),
13325
- new THREE.Vector3(data1[1].x, data1[1].y, groundHeight ? groundHeight : this.doorGroundHeight),
13326
- new THREE.Vector3(data1[2].x, data1[2].y, groundHeight ? groundHeight : this.doorGroundHeight),
13326
+ new THREE.Vector3(data1[0].x, data1[0].y, groundHeight),
13327
+ new THREE.Vector3(data1[1].x, data1[1].y, groundHeight),
13328
+ new THREE.Vector3(data1[2].x, data1[2].y, groundHeight),
13327
13329
  // 可以不是矩形
13328
- new THREE.Vector3(data1[3].x, data1[3].y, groundHeight ? groundHeight : this.doorGroundHeight)
13330
+ new THREE.Vector3(data1[3].x, data1[3].y, groundHeight)
13329
13331
  ];
13330
13332
  const basePoints2 = [
13331
- new THREE.Vector3(data[0].x, data1[0].y, groundHeight ? groundHeight : this.doorGroundHeight),
13332
- new THREE.Vector3(data[1].x, data1[1].y, groundHeight ? groundHeight : this.doorGroundHeight),
13333
- new THREE.Vector3(data[2].x, data1[2].y, groundHeight ? groundHeight : this.doorGroundHeight),
13333
+ new THREE.Vector3(data[0].x, data1[0].y, groundHeight),
13334
+ new THREE.Vector3(data[1].x, data1[1].y, groundHeight),
13335
+ new THREE.Vector3(data[2].x, data1[2].y, groundHeight),
13334
13336
  // 可以不是矩形
13335
- new THREE.Vector3(data[3].x, data1[3].y, groundHeight ? groundHeight : this.doorGroundHeight)
13337
+ new THREE.Vector3(data[3].x, data1[3].y, groundHeight)
13336
13338
  ];
13337
13339
  const geometry = this.createParallelepipedFromBase(basePoints, 2.8);
13338
13340
  const geometry1 = this.createParallelepipedFromBase(basePoints1, Height ? Height : this.doorHeight);