build-dxf 0.1.152 → 0.1.153
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 +49 -49
- package/src/build.js +42 -13
- package/src/utils/modelScenario/scenario.d.ts +1 -1
package/package.json
CHANGED
|
@@ -1,49 +1,49 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "build-dxf",
|
|
3
|
-
"version": "0.1.
|
|
4
|
-
"description": "",
|
|
5
|
-
"main": "./src/index.js",
|
|
6
|
-
"types": "./src/index.d.ts",
|
|
7
|
-
"scripts": {
|
|
8
|
-
"test": "echo \"Error: no test specified\" && exit 1"
|
|
9
|
-
},
|
|
10
|
-
"exports": {
|
|
11
|
-
".": {
|
|
12
|
-
"import": {
|
|
13
|
-
"types": "./src/build.d.ts",
|
|
14
|
-
"default": "./src/index.js",
|
|
15
|
-
"style": "./src/index.css"
|
|
16
|
-
},
|
|
17
|
-
"require": {
|
|
18
|
-
"types": "./src/build.d.ts",
|
|
19
|
-
"default": "./src/index.js"
|
|
20
|
-
}
|
|
21
|
-
},
|
|
22
|
-
"./RenderPlugin": {
|
|
23
|
-
"import": {
|
|
24
|
-
"types": "./src/utils/DxfSystem/plugin/RenderPlugin/index.d.ts",
|
|
25
|
-
"default": "./src/index2.js"
|
|
26
|
-
},
|
|
27
|
-
"require": {
|
|
28
|
-
"types": "./src/index.d.ts",
|
|
29
|
-
"default": "./src/index2.js"
|
|
30
|
-
}
|
|
31
|
-
},
|
|
32
|
-
"./index.css": "./src/index.css"
|
|
33
|
-
},
|
|
34
|
-
"style": "src/index.css",
|
|
35
|
-
"dependencies": {
|
|
36
|
-
"@tweenjs/tween.js": ">=25.0.0",
|
|
37
|
-
"clipper-lib": ">=6.4.2",
|
|
38
|
-
"dxf-writer": ">=1.18.4",
|
|
39
|
-
"vue": ">=3.0.0",
|
|
40
|
-
"canvas": "3.2.0",
|
|
41
|
-
"three-mesh-bvh": "^0.6.6",
|
|
42
|
-
"three-bvh-csg": ">=0.0.17",
|
|
43
|
-
"three-csg-ts": ">=3.2.0",
|
|
44
|
-
"three": ">=0.181.0",
|
|
45
|
-
"node-three-gltf": "2.1.0"
|
|
46
|
-
},
|
|
47
|
-
"author": "夏过初秋",
|
|
48
|
-
"license": "UNLICENSED"
|
|
49
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "build-dxf",
|
|
3
|
+
"version": "0.1.153",
|
|
4
|
+
"description": "",
|
|
5
|
+
"main": "./src/index.js",
|
|
6
|
+
"types": "./src/index.d.ts",
|
|
7
|
+
"scripts": {
|
|
8
|
+
"test": "echo \"Error: no test specified\" && exit 1"
|
|
9
|
+
},
|
|
10
|
+
"exports": {
|
|
11
|
+
".": {
|
|
12
|
+
"import": {
|
|
13
|
+
"types": "./src/build.d.ts",
|
|
14
|
+
"default": "./src/index.js",
|
|
15
|
+
"style": "./src/index.css"
|
|
16
|
+
},
|
|
17
|
+
"require": {
|
|
18
|
+
"types": "./src/build.d.ts",
|
|
19
|
+
"default": "./src/index.js"
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
"./RenderPlugin": {
|
|
23
|
+
"import": {
|
|
24
|
+
"types": "./src/utils/DxfSystem/plugin/RenderPlugin/index.d.ts",
|
|
25
|
+
"default": "./src/index2.js"
|
|
26
|
+
},
|
|
27
|
+
"require": {
|
|
28
|
+
"types": "./src/index.d.ts",
|
|
29
|
+
"default": "./src/index2.js"
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
"./index.css": "./src/index.css"
|
|
33
|
+
},
|
|
34
|
+
"style": "src/index.css",
|
|
35
|
+
"dependencies": {
|
|
36
|
+
"@tweenjs/tween.js": ">=25.0.0",
|
|
37
|
+
"clipper-lib": ">=6.4.2",
|
|
38
|
+
"dxf-writer": ">=1.18.4",
|
|
39
|
+
"vue": ">=3.0.0",
|
|
40
|
+
"canvas": "3.2.0",
|
|
41
|
+
"three-mesh-bvh": "^0.6.6",
|
|
42
|
+
"three-bvh-csg": ">=0.0.17",
|
|
43
|
+
"three-csg-ts": ">=3.2.0",
|
|
44
|
+
"three": ">=0.181.0",
|
|
45
|
+
"node-three-gltf": "2.1.0"
|
|
46
|
+
},
|
|
47
|
+
"author": "夏过初秋",
|
|
48
|
+
"license": "UNLICENSED"
|
|
49
|
+
}
|
package/src/build.js
CHANGED
|
@@ -12667,8 +12667,18 @@ class BayWindow {
|
|
|
12667
12667
|
}
|
|
12668
12668
|
}
|
|
12669
12669
|
}
|
|
12670
|
-
|
|
12670
|
+
const num = Number(i) + 1;
|
|
12671
|
+
this.bayWindowGroup.name = `飘窗_${num}`;
|
|
12671
12672
|
this.bayWindowGroup.userData.category = "bayWindow";
|
|
12673
|
+
this.bayWindowGroup.userData.width = data[i].data.windowWidth;
|
|
12674
|
+
this.bayWindowGroup.userData.height = data[i].data.height2;
|
|
12675
|
+
this.bayWindowGroup.userData.groundHeight = data[i].data.height3;
|
|
12676
|
+
this.bayWindowGroup.userData.distanceToTheTop = data[i].data.height1;
|
|
12677
|
+
for (const w in data[i].lines) {
|
|
12678
|
+
if (data[i].lines[w].userData.isWindow) {
|
|
12679
|
+
this.bayWindowGroup.userData.depth = data[i].dottedLine.distanceToSegment(data[i].lines[w]);
|
|
12680
|
+
}
|
|
12681
|
+
}
|
|
12672
12682
|
Scenario.Instance.group.add(this.bayWindowGroup);
|
|
12673
12683
|
}
|
|
12674
12684
|
}
|
|
@@ -13455,8 +13465,8 @@ class BayWindow {
|
|
|
13455
13465
|
let height2 = Scenario.Instance.height + objData.height3 + objData.height2;
|
|
13456
13466
|
mesh.position.z = height1;
|
|
13457
13467
|
mesh2.position.z = height2;
|
|
13458
|
-
|
|
13459
|
-
|
|
13468
|
+
this.bayWindowGroup.add(mesh);
|
|
13469
|
+
this.bayWindowGroup.add(mesh2);
|
|
13460
13470
|
}
|
|
13461
13471
|
// 共用线处理
|
|
13462
13472
|
// sharedLineProcessing(sharedLine: any, data: any) {
|
|
@@ -14259,6 +14269,11 @@ class Scenario {
|
|
|
14259
14269
|
installBalconys(data, index2) {
|
|
14260
14270
|
let balconyGroup = new Group$1();
|
|
14261
14271
|
balconyGroup.name = `阳台${index2}`;
|
|
14272
|
+
balconyGroup.userData.category = "balcony";
|
|
14273
|
+
balconyGroup.userData.height = data.userData.height;
|
|
14274
|
+
balconyGroup.userData.width = data.length;
|
|
14275
|
+
balconyGroup.userData.depth = 0;
|
|
14276
|
+
balconyGroup.userData.groundHeight = 0;
|
|
14262
14277
|
const point1 = new THREE.Vector3(data.start.x, data.start.y, 0);
|
|
14263
14278
|
const point2 = new THREE.Vector3(data.end.x, data.end.y, 0);
|
|
14264
14279
|
new THREE.Vector3(data.center.x, data.center.y, 0);
|
|
@@ -14282,7 +14297,7 @@ class Scenario {
|
|
|
14282
14297
|
menModel.scale.set(distance2 / size2.x, height / size2.y, wallWidth / size2.z);
|
|
14283
14298
|
menModel.position.set(data.center.x, data.center.y, this.height);
|
|
14284
14299
|
menModel.name = `阳台_${index2}`;
|
|
14285
|
-
menModel.userData.category = "
|
|
14300
|
+
menModel.userData.category = "balcony_";
|
|
14286
14301
|
balconyGroup.add(menModel);
|
|
14287
14302
|
this.group.add(balconyGroup);
|
|
14288
14303
|
}
|
|
@@ -14317,7 +14332,7 @@ class Scenario {
|
|
|
14317
14332
|
balconyModel.scale.set(spacing / size2.x, height / size2.y, wallWidth / size2.z);
|
|
14318
14333
|
balconyModel.position.set(center.x, center.y, this.height);
|
|
14319
14334
|
balconyModel.name = `阳台_${index2}`;
|
|
14320
|
-
balconyModel.userData.category = "
|
|
14335
|
+
balconyModel.userData.category = "balcony_";
|
|
14321
14336
|
balconyGroup.add(balconyModel);
|
|
14322
14337
|
}
|
|
14323
14338
|
this.group.add(balconyGroup);
|
|
@@ -14751,14 +14766,28 @@ class Scenario {
|
|
|
14751
14766
|
}
|
|
14752
14767
|
// 生成梁模型
|
|
14753
14768
|
generateBeamModel(line) {
|
|
14754
|
-
|
|
14755
|
-
|
|
14756
|
-
|
|
14757
|
-
|
|
14758
|
-
|
|
14759
|
-
|
|
14760
|
-
|
|
14761
|
-
|
|
14769
|
+
let basePoints;
|
|
14770
|
+
if (!line.userData.expansionWidth) {
|
|
14771
|
+
let wallWidth;
|
|
14772
|
+
if (line.userData.wallWidth) {
|
|
14773
|
+
wallWidth = line.userData.wallWidth;
|
|
14774
|
+
} else {
|
|
14775
|
+
wallWidth = 0.06;
|
|
14776
|
+
}
|
|
14777
|
+
const MobileX = this.angleToXAxisDegrees(line.start.x, line.start.y, line.end.x, line.end.y, wallWidth, true);
|
|
14778
|
+
const MobileY = this.angleToXAxisDegrees(line.start.x, line.start.y, line.end.x, line.end.y, wallWidth, false);
|
|
14779
|
+
let startingPoint = this.xinLine(MobileX, MobileY, line.start, 0);
|
|
14780
|
+
let finishLine = this.xinLine(MobileX, MobileY, line.end, 1);
|
|
14781
|
+
basePoints = [startingPoint[0], startingPoint[1], finishLine[1], finishLine[0]];
|
|
14782
|
+
} else {
|
|
14783
|
+
const directionX = line.userData.expansionDirction.x * line.userData.expansionWidth;
|
|
14784
|
+
const directionY = line.userData.expansionDirction.y * line.userData.expansionWidth;
|
|
14785
|
+
let pointStart = new THREE.Vector3(line.start.x, line.start.y, this.height);
|
|
14786
|
+
let pointEnd = new THREE.Vector3(line.end.x, line.end.y, this.height);
|
|
14787
|
+
let startExpansion = new THREE.Vector3(pointStart.x + directionX, pointStart.y + directionY, this.height);
|
|
14788
|
+
let endExpansion = new THREE.Vector3(pointEnd.x + directionX, pointEnd.y + directionY, this.height);
|
|
14789
|
+
basePoints = [pointStart, pointEnd, endExpansion, startExpansion];
|
|
14790
|
+
}
|
|
14762
14791
|
const geometry = this.createParallelepipedFromBase(basePoints, line.userData.height);
|
|
14763
14792
|
const material = new THREE.MeshStandardMaterial({
|
|
14764
14793
|
// color: 0x4f90d4,
|
|
@@ -74,7 +74,7 @@ export default class Scenario {
|
|
|
74
74
|
overhangWallOffset(data: any, index: string, height: number): THREE.Mesh<THREE.ExtrudeGeometry, THREE.MeshStandardMaterial, THREE.Object3DEventMap> | null;
|
|
75
75
|
dashedLineCeilingTreatment(data: any, index: number | string, item: any): THREE.Mesh<THREE.ExtrudeGeometry, THREE.MeshStandardMaterial, THREE.Object3DEventMap> | null;
|
|
76
76
|
overallTreatmentOfSingleLineWalls(data: any): void;
|
|
77
|
-
generateBeamModel(line: any): Brush
|
|
77
|
+
generateBeamModel(line: any): Brush;
|
|
78
78
|
generateColumnModel(data: any, lines: any, Height: number): THREE.Mesh<THREE.ExtrudeGeometry, THREE.MeshStandardMaterial, THREE.Object3DEventMap> | null;
|
|
79
79
|
createAPlane(lines: LineSegment<Record<string, any>>[], menList: LineSegment<Record<string, any>>[]): void;
|
|
80
80
|
modelLoader(): Promise<void>;
|