-
Notifications
You must be signed in to change notification settings - Fork 19
Expand file tree
/
Copy pathIfcImporter.ts
More file actions
81 lines (49 loc) · 1.94 KB
/
IfcImporter.ts
File metadata and controls
81 lines (49 loc) · 1.94 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
// import { IFC4X3 as IFC } from "web-ifc-three";
// import * as WEBIFC from "web-ifc";
// import * as THREE from "three";
// import { ClayGeometry } from "../Geometry";
// import { Model } from "../base";
// import { IfcUtils } from "../utils/ifc-utils";
// class IfcImporter {
// constructor(model: Model) {
// }
// async loadIfcFile(file: File): Promise<void> {
// const data = await this.parseIfcFile(file);
// this.generateObjects(data);
// }
// private async parseIfcFile(file: File): Promise<any> {
// const ifcApi = new WEBIFC.IfcAPI();
// // initialize the library
// await ifcApi.Init();
// const ifcLoader = new WEBIFC.IfcLoader();
// ifcApi.LoadIfc(filePath);
// // Set a callback when the WASM is loaded
// ifcAPI.SetWasmLoadedCallback(() => {
// // Get all IFC elements
// const allElements = ifcAPI.GetAllElements();
// // Extract GUIDs
// const guids: string[] = [];
// allElements.forEach(element => {
// if (element.guid) {
// guids.push(element.guid);
// }
// });
// resolve(guids);
// });
// }
// // const ifcParser = new THREE.
// // ifcParser.load('example.ifc', (ifcData) => {
// // // Convert IFC data to THREE.js objects
// // const threeObjects = convertIFCDataToThreeObjects(ifcData);
// }
// private generateObjects(data: any): void {
// data.forEach((elementData: any) => {
// // Create all of objects separately to edit in the future
// if (elementData.type === 'wall') {
// // const wall = new Wall();
// } else if (elementData.type === 'slab') {
// // const slab = new Slab();
// }
// });
// }
// }