diff --git a/docs/app/main.js b/docs/app/main.js index 769507a..89f4d61 100644 --- a/docs/app/main.js +++ b/docs/app/main.js @@ -10862,7 +10862,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; -eval("\r\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n};\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.IfcLoader = void 0;\r\n__webpack_require__(/*! @babylonjs/loaders/glTF */ \"./node_modules/@babylonjs/loaders/glTF/index.js\");\r\nconst BABYLON = __webpack_require__(/*! @babylonjs/core */ \"./node_modules/@babylonjs/core/index.js\");\r\nconst WEBIFC = __webpack_require__(/*! web-ifc/web-ifc-api */ \"./node_modules/web-ifc/web-ifc-api.js\");\r\nclass IfcLoader {\r\n constructor() {\r\n this.ifcAPI = new WEBIFC.IfcAPI();\r\n this.meshmaterials = new Map();\r\n }\r\n initialize() {\r\n return __awaiter(this, void 0, void 0, function* () {\r\n yield this.ifcAPI.Init();\r\n });\r\n }\r\n load(name, file, scene) {\r\n return __awaiter(this, void 0, void 0, function* () {\r\n var scope = this;\r\n yield this.ifcAPI.Init();\r\n return this.parse(name, file, scene);\r\n });\r\n }\r\n parse(url, buffer, scene) {\r\n return __awaiter(this, void 0, void 0, function* () {\r\n var mToggle_YZ = [\r\n 1, 0, 0, 0,\r\n 0, -1, 0, 0,\r\n 0, 0, -1, 0,\r\n 0, 0, 0, -1\r\n ];\r\n var modelID = yield this.ifcAPI.OpenModel(url, buffer);\r\n yield this.ifcAPI.SetGeometryTransformation(modelID, mToggle_YZ);\r\n var result = this.loadAllGeometry(modelID, scene);\r\n return result;\r\n });\r\n }\r\n loadAllGeometry(modelID, scene) {\r\n return __awaiter(this, void 0, void 0, function* () {\r\n var flatMeshes = this.getFlatMeshes(modelID);\r\n var mainObject = new BABYLON.Mesh(\"custom\", scene);\r\n for (var i = 0; i < flatMeshes.size(); i++) {\r\n var placedGeometries = flatMeshes.get(i).geometries;\r\n for (var j = 0; j < placedGeometries.size(); j++) {\r\n const mesh = this.getPlacedGeometry(modelID, placedGeometries.get(j), scene, mainObject);\r\n // if (mesh != null) {\r\n // mesh.name = flatMeshes.get(i).expressID.toString();\r\n // mesh.parent = mainObject;\r\n // }\r\n }\r\n }\r\n console.log(\"Materials: \" + this.meshmaterials.size);\r\n console.log(\"Meshes: \" + mainObject.getChildren().length);\r\n // mainObject.getChildren().forEach(element => {\r\n // console.log(element.name);\r\n // });\r\n return mainObject;\r\n });\r\n }\r\n getFlatMeshes(modelID) {\r\n var flatMeshes = this.ifcAPI.LoadAllGeometry(modelID);\r\n return flatMeshes;\r\n }\r\n getPlacedGeometry(modelID, placedGeometry, scene, mainObject) {\r\n var meshgeometry = this.getBufferGeometry(modelID, placedGeometry, scene);\r\n if (meshgeometry != null) {\r\n var material = this.getMeshMaterial(placedGeometry.color, scene);\r\n var m = placedGeometry.flatTransformation;\r\n var matrix = new BABYLON.Matrix();\r\n matrix.setRowFromFloats(0, m[0], m[1], m[2], m[3]);\r\n matrix.setRowFromFloats(1, m[4], m[5], m[6], m[7]);\r\n matrix.setRowFromFloats(2, m[8], m[9], m[10], m[11]);\r\n matrix.setRowFromFloats(3, m[12], m[13], m[14], m[15]);\r\n // Some IFC files are not parsed correctly, leading to degenerated meshes\r\n try {\r\n meshgeometry.bakeTransformIntoVertices(matrix);\r\n }\r\n catch (_a) {\r\n console.warn(\"Unable to bake transform matrix into vertex array. Some elements may be in the wrong position.\");\r\n }\r\n let color = placedGeometry.color;\r\n let colorid = (color.x + (color.y) * 256 + (color.z) * Math.pow(256, 2) + (color.w) * Math.pow(256, 3)).toFixed(0);\r\n if (this.meshmaterials.has(colorid)) {\r\n var tempmesh = this.meshmaterials.get(colorid);\r\n // console.log(\"Adding new mesh \" + meshgeometry.name + \" to mesh: \" + tempmesh.name);\r\n meshgeometry.material = tempmesh.material;\r\n var mergedmesh = BABYLON.Mesh.MergeMeshes([tempmesh, meshgeometry]);\r\n mergedmesh.name = colorid.toString(16);\r\n this.meshmaterials.set(colorid, mergedmesh);\r\n mergedmesh.parent = mainObject;\r\n }\r\n else {\r\n console.log(\"Adding material with id: \" + colorid.toString(16));\r\n var newMaterial = this.getMeshMaterial(color, scene);\r\n meshgeometry.material = newMaterial;\r\n this.meshmaterials.set(colorid, meshgeometry);\r\n meshgeometry.parent = mainObject;\r\n }\r\n return meshgeometry;\r\n }\r\n else\r\n return null;\r\n }\r\n getBufferGeometry(modelID, placedGeometry, scene) {\r\n var geometry = this.ifcAPI.GetGeometry(modelID, placedGeometry.geometryExpressID);\r\n if (geometry.GetVertexDataSize() !== 0) {\r\n var vertices = this.ifcAPI.GetVertexArray(geometry.GetVertexData(), geometry.GetVertexDataSize());\r\n var indices = this.ifcAPI.GetIndexArray(geometry.GetIndexData(), geometry.GetIndexDataSize());\r\n var mesh = new BABYLON.Mesh(\"custom\", scene);\r\n var vertexData = this.getVertexData(vertices, indices);\r\n vertexData.applyToMesh(mesh, false);\r\n return mesh;\r\n }\r\n else\r\n return null;\r\n }\r\n getVertexData(vertices, indices) {\r\n var positions = new Array(Math.floor(vertices.length / 2));\r\n var normals = new Array(Math.floor(vertices.length / 2));\r\n for (var i = 0; i < vertices.length / 6; i++) {\r\n positions[i * 3 + 0] = vertices[i * 6 + 0]; //* 0.001; \r\n positions[i * 3 + 1] = vertices[i * 6 + 1]; //* 0.001; \r\n positions[i * 3 + 2] = vertices[i * 6 + 2]; //* 0.001; \r\n normals[i * 3 + 0] = vertices[i * 6 + 3]; //* 0.001; \r\n normals[i * 3 + 1] = vertices[i * 6 + 4]; //* 0.001; \r\n normals[i * 3 + 2] = vertices[i * 6 + 5]; //* 0.001; \r\n }\r\n var vertexData = new BABYLON.VertexData();\r\n vertexData.positions = positions;\r\n vertexData.normals = normals;\r\n vertexData.indices = indices;\r\n return vertexData;\r\n }\r\n getMeshMaterial(color, scene) {\r\n var myMaterial = new BABYLON.StandardMaterial(\"myMaterial\", scene);\r\n myMaterial.emissiveColor = new BABYLON.Color3(color.x, color.y, color.z);\r\n // if material has alpha - make it fully transparent for performance\r\n myMaterial.alpha = (color.w < 1.0 ? 0 : 1);\r\n myMaterial.sideOrientation = BABYLON.Mesh.DOUBLESIDE;\r\n myMaterial.backFaceCulling = false;\r\n myMaterial.disableLighting = true;\r\n return myMaterial;\r\n }\r\n}\r\nexports.IfcLoader = IfcLoader;\r\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly93ZWItaWZjLWJhYnlsb24vLi9zcmMvSWZjTG9hZGVyLnRzP2E0ZDMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7Ozs7O0FBQUEsc0dBQWlDO0FBQ2pDLHNHQUEyQztBQUMzQyx1R0FBNkM7QUFJN0MsTUFBYSxTQUFTO0lBQ2xCO1FBSVEsV0FBTSxHQUFHLElBQUksTUFBTSxDQUFDLE1BQU0sRUFBRSxDQUFDO1FBRTdCLGtCQUFhLEdBQThCLElBQUksR0FBRyxFQUF5QixDQUFDO0lBSnBGLENBQUM7SUFNSyxVQUFVOztZQUNaLE1BQU0sSUFBSSxDQUFDLE1BQU0sQ0FBQyxJQUFJLEVBQUUsQ0FBQztRQUM3QixDQUFDO0tBQUE7SUFFSyxJQUFJLENBQUMsSUFBSSxFQUFFLElBQUksRUFBRSxLQUFLOztZQUN4QixJQUFJLEtBQUss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gcmV0dXJuIG51bGw7XHJcbiAgICB9XHJcblxyXG4gICAgZ2V0VmVydGV4RGF0YSh2ZXJ0aWNlczogRmxvYXQzMkFycmF5LCBpbmRpY2VzOiBJbmRpY2VzQXJyYXkpIHtcclxuICAgICAgICB2YXIgcG9zaXRpb25zID0gbmV3IEFycmF5KE1hdGguZmxvb3IodmVydGljZXMubGVuZ3RoIC8gMikpO1xyXG4gICAgICAgIHZhciBub3JtYWxzID0gbmV3IEFycmF5KE1hdGguZmxvb3IodmVydGljZXMubGVuZ3RoIC8gMikpO1xyXG4gICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgdmVydGljZXMubGVuZ3RoIC8gNjsgaSsrKSB7XHJcbiAgICAgICAgICAgIHBvc2l0aW9uc1tpICogMyArIDBdID0gdmVydGljZXNbaSAqIDYgKyAwXSAvLyogMC4wMDE7ICAgICAgICAgICAgXHJcbiAgICAgICAgICAgIHBvc2l0aW9uc1tpICogMyArIDFdID0gdmVydGljZXNbaSAqIDYgKyAxXSAvLyogMC4wMDE7ICAgICAgICAgICAgXHJcbiAgICAgICAgICAgIHBvc2l0aW9uc1tpICogMyArIDJdID0gdmVydGljZXNbaSAqIDYgKyAyXSAvLyogMC4wMDE7ICAgICAgICAgICAgXHJcbiAgICAgICAgICAgIG5vcm1hbHNbaSAqIDMgKyAwXSA9IHZlcnRpY2VzW2kgKiA2ICsgM10gLy8qIDAuMDAxOyAgICAgICAgICAgIFxyXG4gICAgICAgICAgICBub3JtYWxzW2kgKiAzICsgMV0gPSB2ZXJ0aWNlc1tpICogNiArIDRdIC8vKiAwLjAwMTsgICAgICAgICAgICBcclxuICAgICAgICAgICAgbm9ybWFsc1tpICogMyArIDJdID0gdmVydGljZXNbaSAqIDYgKyA1XSAvLyogMC4wMDE7ICAgICAgICAgICAgXHJcbiAgICAgICAgfVxyXG4gICAgICAgIHZhciB2ZXJ0ZXhEYXRhID0gbmV3IEJBQllMT04uVmVydGV4RGF0YSgpO1xyXG4gICAgICAgIHZlcnRleERhdGEucG9zaXRpb25zID0gcG9zaXRpb25zO1xyXG4gICAgICAgIHZlcnRleERhdGEubm9ybWFscyA9IG5vcm1hbHM7XHJcbiAgICAgICAgdmVydGV4RGF0YS5pbmRpY2VzID0gaW5kaWNlcztcclxuXHJcbiAgICAgICAgcmV0dXJuIHZlcnRleERhdGE7XHJcbiAgICB9XHJcblxyXG4gICAgZ2V0TWVzaE1hdGVyaWFsKGNvbG9yLCBzY2VuZSkge1xyXG4gICAgICAgIHZhciBteU1hdGVyaWFsID0gbmV3IEJBQllMT04uU3RhbmRhcmRNYXRlcmlhbChcIm15TWF0ZXJpYWxcIiwgc2NlbmUpO1xyXG5cclxuICAgICAgICBteU1hdGVyaWFsLmVtaXNzaXZlQ29sb3IgPSBuZXcgQkFCWUxPTi5Db2xvcjMoY29sb3IueCwgY29sb3IueSwgY29sb3Iueik7XHJcbiAgICAgICAgLy8gaWYgbWF0ZXJpYWwgaGFzIGFscGhhIC0gbWFrZSBpdCBmdWxseSB0cmFuc3BhcmVudCBmb3IgcGVyZm9ybWFuY2VcclxuICAgICAgICBteU1hdGVyaWFsLmFscGhhID0gKGNvbG9yLnc8MS4wPzA6MSk7XHJcbiAgICAgICAgbXlNYXRlcmlhbC5zaWRlT3JpZW50YXRpb24gPSBCQUJZTE9OLk1lc2guRE9VQkxFU0lERTtcclxuICAgICAgICBteU1hdGVyaWFsLmJhY2tGYWNlQ3VsbGluZyA9IGZhbHNlO1xyXG4gICAgICAgIG15TWF0ZXJpYWwuZGlzYWJsZUxpZ2h0aW5nID0gdHJ1ZTsgICAgXHJcblxyXG4gICAgICAgIHJldHVybiBteU1hdGVyaWFsO1xyXG4gICAgfVxyXG59Il0sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./src/IfcLoader.ts\n"); +eval("\r\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n};\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.IfcLoader = void 0;\r\n__webpack_require__(/*! @babylonjs/loaders/glTF */ \"./node_modules/@babylonjs/loaders/glTF/index.js\");\r\nconst BABYLON = __webpack_require__(/*! @babylonjs/core */ \"./node_modules/@babylonjs/core/index.js\");\r\nconst WEBIFC = __webpack_require__(/*! web-ifc/web-ifc-api */ \"./node_modules/web-ifc/web-ifc-api.js\");\r\nclass IfcLoader {\r\n constructor() {\r\n this.ifcAPI = new WEBIFC.IfcAPI();\r\n this.meshmaterials = new Map();\r\n }\r\n initialize() {\r\n return __awaiter(this, void 0, void 0, function* () {\r\n yield this.ifcAPI.Init();\r\n });\r\n }\r\n load(name, file, scene, mergematerials) {\r\n return __awaiter(this, void 0, void 0, function* () {\r\n var scope = this;\r\n yield this.ifcAPI.Init();\r\n var mToggle_YZ = [\r\n 1, 0, 0, 0,\r\n 0, -1, 0, 0,\r\n 0, 0, -1, 0,\r\n 0, 0, 0, -1\r\n ];\r\n var modelID = yield this.ifcAPI.OpenModel(name, file);\r\n yield this.ifcAPI.SetGeometryTransformation(modelID, mToggle_YZ);\r\n var flatMeshes = this.getFlatMeshes(modelID);\r\n var mainObject = new BABYLON.Mesh(\"custom\", scene);\r\n for (var i = 0; i < flatMeshes.size(); i++) {\r\n var placedGeometries = flatMeshes.get(i).geometries;\r\n for (var j = 0; j < placedGeometries.size(); j++) {\r\n const mesh = this.getPlacedGeometry(modelID, placedGeometries.get(j), scene, mainObject, mergematerials);\r\n }\r\n }\r\n console.log(\"Materials: \" + this.meshmaterials.size);\r\n console.log(\"Meshes: \" + mainObject.getChildren().length);\r\n return mainObject;\r\n });\r\n }\r\n getFlatMeshes(modelID) {\r\n var flatMeshes = this.ifcAPI.LoadAllGeometry(modelID);\r\n return flatMeshes;\r\n }\r\n getPlacedGeometry(modelID, placedGeometry, scene, mainObject, mergematerials) {\r\n var meshgeometry = this.getBufferGeometry(modelID, placedGeometry, scene);\r\n if (meshgeometry != null) {\r\n var material = this.getMeshMaterial(placedGeometry.color, scene);\r\n var m = placedGeometry.flatTransformation;\r\n var matrix = new BABYLON.Matrix();\r\n matrix.setRowFromFloats(0, m[0], m[1], m[2], m[3]);\r\n matrix.setRowFromFloats(1, m[4], m[5], m[6], m[7]);\r\n matrix.setRowFromFloats(2, m[8], m[9], m[10], m[11]);\r\n matrix.setRowFromFloats(3, m[12], m[13], m[14], m[15]);\r\n // Some IFC files are not parsed correctly, leading to degenerated meshes\r\n try {\r\n meshgeometry.bakeTransformIntoVertices(matrix);\r\n }\r\n catch (_a) {\r\n console.warn(\"Unable to bake transform matrix into vertex array. Some elements may be in the wrong position.\");\r\n }\r\n let color = placedGeometry.color;\r\n let colorid = (color.x + (color.y) * 256 + (color.z) * Math.pow(256, 2) + (color.w) * Math.pow(256, 3)).toFixed(0);\r\n if (mergematerials && this.meshmaterials.has(colorid)) {\r\n var tempmesh = this.meshmaterials.get(colorid);\r\n // console.log(\"Adding new mesh \" + meshgeometry.name + \" to mesh: \" + tempmesh.name);\r\n meshgeometry.material = tempmesh.material;\r\n var mergedmesh = BABYLON.Mesh.MergeMeshes([tempmesh, meshgeometry]);\r\n mergedmesh.name = colorid.toString(16);\r\n this.meshmaterials.set(colorid, mergedmesh);\r\n mergedmesh.parent = mainObject;\r\n }\r\n else {\r\n var newMaterial = this.getMeshMaterial(color, scene);\r\n meshgeometry.material = newMaterial;\r\n this.meshmaterials.set(colorid, meshgeometry);\r\n meshgeometry.parent = mainObject;\r\n }\r\n return meshgeometry;\r\n }\r\n else\r\n return null;\r\n }\r\n getBufferGeometry(modelID, placedGeometry, scene) {\r\n var geometry = this.ifcAPI.GetGeometry(modelID, placedGeometry.geometryExpressID);\r\n if (geometry.GetVertexDataSize() !== 0) {\r\n var vertices = this.ifcAPI.GetVertexArray(geometry.GetVertexData(), geometry.GetVertexDataSize());\r\n var indices = this.ifcAPI.GetIndexArray(geometry.GetIndexData(), geometry.GetIndexDataSize());\r\n var mesh = new BABYLON.Mesh(\"custom\", scene);\r\n var vertexData = this.getVertexData(vertices, indices);\r\n vertexData.applyToMesh(mesh, false);\r\n return mesh;\r\n }\r\n else\r\n return null;\r\n }\r\n getVertexData(vertices, indices) {\r\n var positions = new Array(Math.floor(vertices.length / 2));\r\n var normals = new Array(Math.floor(vertices.length / 2));\r\n for (var i = 0; i < vertices.length / 6; i++) {\r\n positions[i * 3 + 0] = vertices[i * 6 + 0]; //* 0.001; \r\n positions[i * 3 + 1] = vertices[i * 6 + 1]; //* 0.001; \r\n positions[i * 3 + 2] = vertices[i * 6 + 2]; //* 0.001; \r\n normals[i * 3 + 0] = vertices[i * 6 + 3]; //* 0.001; \r\n normals[i * 3 + 1] = vertices[i * 6 + 4]; //* 0.001; \r\n normals[i * 3 + 2] = vertices[i * 6 + 5]; //* 0.001; \r\n }\r\n var vertexData = new BABYLON.VertexData();\r\n vertexData.positions = positions;\r\n vertexData.normals = normals;\r\n vertexData.indices = indices;\r\n return vertexData;\r\n }\r\n getMeshMaterial(color, scene) {\r\n var myMaterial = new BABYLON.StandardMaterial(\"myMaterial\", scene);\r\n myMaterial.emissiveColor = new BABYLON.Color3(color.x, color.y, color.z);\r\n // if material has alpha - make it fully transparent for performance\r\n myMaterial.alpha = (color.w < 1.0 ? 0 : 1);\r\n myMaterial.sideOrientation = BABYLON.Mesh.DOUBLESIDE;\r\n myMaterial.backFaceCulling = false;\r\n myMaterial.disableLighting = true;\r\n return myMaterial;\r\n }\r\n}\r\nexports.IfcLoader = IfcLoader;\r\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJ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xyXG4gICAgICAgIG15TWF0ZXJpYWwuYmFja0ZhY2VDdWxsaW5nID0gZmFsc2U7XHJcbiAgICAgICAgbXlNYXRlcmlhbC5kaXNhYmxlTGlnaHRpbmcgPSB0cnVlOyAgICBcclxuXHJcbiAgICAgICAgcmV0dXJuIG15TWF0ZXJpYWw7XHJcbiAgICB9XHJcbn0iXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./src/IfcLoader.ts\n"); /***/ }), @@ -10873,7 +10873,7 @@ eval("\r\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _argume /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; -eval("\r\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n};\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nconst BABYLON = __webpack_require__(/*! @babylonjs/core */ \"./node_modules/@babylonjs/core/index.js\");\r\nconst GUI = __webpack_require__(/*! @babylonjs/gui */ \"./node_modules/@babylonjs/gui/index.js\");\r\n__webpack_require__(/*! @babylonjs/loaders/glTF */ \"./node_modules/@babylonjs/loaders/glTF/index.js\");\r\nconst IFCLOADER = __webpack_require__(/*! ./IfcLoader */ \"./src/IfcLoader.ts\");\r\nconst test_ifc_1 = __webpack_require__(/*! ./test.ifc */ \"./src/test.ifc\");\r\nclass App {\r\n createContent() {\r\n return __awaiter(this, void 0, void 0, function* () {\r\n // create the canvas html element and attach it to the webpage\r\n var canvas = document.createElement(\"canvas\");\r\n canvas.style.width = \"100%\";\r\n canvas.style.height = \"100%\";\r\n canvas.id = \"gameCanvas\";\r\n document.body.appendChild(canvas);\r\n // Load the 3D engine\r\n var engine = new BABYLON.Engine(canvas, true, { preserveDrawingBuffer: true, stencil: true });\r\n // CreateScene function that creates and return the scene\r\n var createScene = function () {\r\n // Create a basic BJS Scene object\r\n var scene = new BABYLON.Scene(engine);\r\n // Create a FreeCamera, and set its position to {x: 0, y: 5, z: -10}\r\n var camera = new BABYLON.FreeCamera('camera1', new BABYLON.Vector3(0, 5, -10), scene);\r\n // Target the camera to scene origin\r\n camera.setTarget(BABYLON.Vector3.Zero());\r\n // Attach the camera to the canvas\r\n camera.attachControl(canvas, false);\r\n //Controls WASD\r\n camera.keysUp.push(87);\r\n camera.keysDown.push(83);\r\n camera.keysRight.push(68);\r\n camera.keysLeft.push(65);\r\n // // Create a light and aim it vertically to the sky (0, 1, 0).\r\n // let light = new BABYLON.HemisphericLight('light-1', new BABYLON.Vector3(0, 1, 0), scene);\r\n // // Create another light and aim it vertically to the ground (0, -1, 0).\r\n // let downlight = new BABYLON.HemisphericLight('light-2', new BABYLON.Vector3(0, -1, 0), scene);\r\n // // Set light intensity to a lower value (default is 1).\r\n // light.intensity = 0.9;\r\n // downlight.intensity = 0.8;\r\n // Return the created scene\r\n return scene;\r\n };\r\n // call the createScene function\r\n var scene = createScene();\r\n // Create a default environment for the scene.\r\n const env = scene.createDefaultEnvironment({\r\n createSkybox: false\r\n });\r\n // here we add XR support\r\n if (env != null) {\r\n const xrHelper = scene.createDefaultXRExperienceAsync({\r\n // floorMeshes: [env.ground],\r\n disableDefaultUI: false\r\n });\r\n }\r\n else {\r\n console.log('WebXR environment is unavailable');\r\n }\r\n var filesInput = new BABYLON.FilesInput(engine, scene, null, null, null, null, function () {\r\n BABYLON.Tools.ClearLogCache();\r\n }, null, null);\r\n // let divFps = document.getElementById(\"fps\");\r\n // GUI\r\n var plane = BABYLON.MeshBuilder.CreatePlane(\"plane\", { size: 2 });\r\n plane.position.z = -1;\r\n plane.position.y = 2;\r\n plane.position.x = 2;\r\n var advancedTexture = GUI.AdvancedDynamicTexture.CreateForMesh(plane);\r\n var text1 = new GUI.TextBlock;\r\n text1.width = 1;\r\n text1.height = 0.4;\r\n text1.color = \"white\";\r\n text1.fontSize = 120;\r\n text1.fontWeight = \"bold\";\r\n text1.text = \"0 fps\";\r\n // text1.transformCenterX = 10;\r\n // text1.horizontalAlignment = 10;\r\n // text1.verticalAlignment= -100;\r\n // text1._moveToProjectedPosition(new BABYLON.Vector3(0,1,1));\r\n advancedTexture.addControl(text1);\r\n // text1.linkOffsetY = 1;\r\n // run the render loop\r\n engine.runRenderLoop(function () {\r\n scene.render();\r\n // divFps.innerHTML = engine.getFps().toFixed() + \" fps\";\r\n text1.text = engine.getFps().toFixed() + \" fps\";\r\n });\r\n // Initialize IFC loader\r\n var ifc = new IFCLOADER.IfcLoader();\r\n ifc.initialize();\r\n // Set up drag and drop for loading files\r\n filesInput.onProcessFileCallback = (file, name, extension) => {\r\n console.log(\"Reading file: \" + name);\r\n file.text().then(buf => {\r\n // delete existing objects\r\n try {\r\n this.mesh.dispose();\r\n }\r\n catch (_a) {\r\n //\r\n }\r\n this.mesh = ifc.load(name, buf, scene).then(() => {\r\n console.log(\"Done processing file: \" + name);\r\n });\r\n });\r\n return true;\r\n };\r\n filesInput.monitorElementForDragNDrop(canvas);\r\n // add the canvas/window resize event handler\r\n window.addEventListener('resize', function () {\r\n engine.resize();\r\n });\r\n var buffer = test_ifc_1.default;\r\n this.mesh = yield ifc.load(\"Sample model\", buffer, scene);\r\n });\r\n }\r\n}\r\nvar app = new App();\r\napp.createContent();\r\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly93ZWItaWZjLWJhYnlsb24vLi9zcmMvYXBwLnRzPzA2NmUiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7Ozs7QUFB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hY2sgPSAoZmlsZTogRmlsZSwgbmFtZSwgZXh0ZW5zaW9uKSA9PiB7XHJcbiAgICAgICAgICAgIGNvbnNvbGUubG9nKFwiUmVhZGluZyBmaWxlOiBcIiArIG5hbWUpO1xyXG4gICAgICAgICAgICBmaWxlLnRleHQoKS50aGVuKGJ1ZiA9PiB7XHJcbiAgICAgICAgICAgICAgICAvLyBkZWxldGUgZXhpc3Rpbmcgb2JqZWN0c1xyXG4gICAgICAgICAgICAgICAgdHJ5IHtcclxuICAgICAgICAgICAgICAgICAgICB0aGlzLm1lc2guZGlzcG9zZSgpO1xyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgY2F0Y2gge1xyXG4gICAgICAgICAgICAgICAgICAgIC8vXHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICB0aGlzLm1lc2ggPSBpZmMubG9hZChuYW1lLCBidWYsIHNjZW5lKS50aGVuKCgpID0+IHtcclxuICAgICAgICAgICAgICAgICAgICBjb25zb2xlLmxvZyhcIkRvbmUgcHJvY2Vzc2luZyBmaWxlOiBcIiArIG5hbWUpO1xyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgKTtcclxuICAgICAgICAgICAgfSk7XHJcbiAgICAgICAgICAgIHJldHVybiB0cnVlO1xyXG4gICAgICAgIH07XHJcblxyXG4gICAgICAgIGZpbGVzSW5wdXQubW9uaXRvckVsZW1lbnRGb3JEcmFnTkRyb3AoY2FudmFzKTtcclxuXHJcbiAgICAgICAgLy8gYWRkIHRoZSBjYW52YXMvd2luZG93IHJlc2l6ZSBldmVudCBoYW5kbGVyXHJcbiAgICAgICAgd2luZG93LmFkZEV2ZW50TGlzdGVuZXIoJ3Jlc2l6ZScsIGZ1bmN0aW9uICgpIHtcclxuICAgICAgICAgICAgZW5naW5lLnJlc2l6ZSgpO1xyXG4gICAgICAgIH0pO1xyXG4gICAgICAgIHZhciBidWZmZXI6c3RyaW5nID0gc2FtcGxlSWZjO1xyXG4gICAgICAgIHRoaXMubWVzaCA9IGF3YWl0IGlmYy5sb2FkKFwiU2FtcGxlIG1vZGVsXCIsIGJ1ZmZlciwgc2NlbmUpO1xyXG4gICAgfVxyXG59XHJcbnZhciBhcHAgPSBuZXcgQXBwKCk7XHJcbmFwcC5jcmVhdGVDb250ZW50KCk7Il0sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./src/app.ts\n"); +eval("\r\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n};\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nconst BABYLON = __webpack_require__(/*! @babylonjs/core */ \"./node_modules/@babylonjs/core/index.js\");\r\nconst GUI = __webpack_require__(/*! @babylonjs/gui */ \"./node_modules/@babylonjs/gui/index.js\");\r\n__webpack_require__(/*! @babylonjs/loaders/glTF */ \"./node_modules/@babylonjs/loaders/glTF/index.js\");\r\nconst IFCLOADER = __webpack_require__(/*! ./IfcLoader */ \"./src/IfcLoader.ts\");\r\nconst test_ifc_1 = __webpack_require__(/*! ./test.ifc */ \"./src/test.ifc\");\r\nclass App {\r\n createContent() {\r\n return __awaiter(this, void 0, void 0, function* () {\r\n // create the canvas html element and attach it to the webpage\r\n var canvas = document.createElement(\"canvas\");\r\n canvas.style.width = \"100%\";\r\n canvas.style.height = \"100%\";\r\n canvas.id = \"gameCanvas\";\r\n document.body.appendChild(canvas);\r\n // Load the 3D engine\r\n var engine = new BABYLON.Engine(canvas, true, { preserveDrawingBuffer: true, stencil: true });\r\n // CreateScene function that creates and return the scene\r\n var createScene = function () {\r\n // Create a basic BJS Scene object\r\n var scene = new BABYLON.Scene(engine);\r\n // Create a FreeCamera, and set its position to {x: 0, y: 5, z: -10}\r\n var camera = new BABYLON.FreeCamera('camera1', new BABYLON.Vector3(0, 5, -10), scene);\r\n // Target the camera to scene origin\r\n camera.setTarget(BABYLON.Vector3.Zero());\r\n // Attach the camera to the canvas\r\n camera.attachControl(canvas, false);\r\n //Controls WASD\r\n camera.keysUp.push(87);\r\n camera.keysDown.push(83);\r\n camera.keysRight.push(68);\r\n camera.keysLeft.push(65);\r\n // // Create a light and aim it vertically to the sky (0, 1, 0).\r\n // let light = new BABYLON.HemisphericLight('light-1', new BABYLON.Vector3(0, 1, 0), scene);\r\n // // Create another light and aim it vertically to the ground (0, -1, 0).\r\n // let downlight = new BABYLON.HemisphericLight('light-2', new BABYLON.Vector3(0, -1, 0), scene);\r\n // // Set light intensity to a lower value (default is 1).\r\n // light.intensity = 0.9;\r\n // downlight.intensity = 0.8;\r\n // Return the created scene\r\n return scene;\r\n };\r\n // call the createScene function\r\n var scene = createScene();\r\n // Create a default environment for the scene.\r\n const env = scene.createDefaultEnvironment({\r\n createSkybox: false\r\n });\r\n // here we add XR support\r\n if (env != null) {\r\n const xrHelper = scene.createDefaultXRExperienceAsync({\r\n // floorMeshes: [env.ground],\r\n disableDefaultUI: false\r\n });\r\n }\r\n else {\r\n console.log('WebXR environment is unavailable');\r\n }\r\n var filesInput = new BABYLON.FilesInput(engine, scene, null, null, null, null, function () {\r\n BABYLON.Tools.ClearLogCache();\r\n }, null, null);\r\n // let divFps = document.getElementById(\"fps\");\r\n // GUI\r\n var plane = BABYLON.MeshBuilder.CreatePlane(\"plane\", { size: 2 });\r\n plane.position.z = -1;\r\n plane.position.y = 2;\r\n plane.position.x = 2;\r\n var advancedTexture = GUI.AdvancedDynamicTexture.CreateForMesh(plane);\r\n var text1 = new GUI.TextBlock;\r\n text1.width = 1;\r\n text1.height = 0.4;\r\n text1.color = \"white\";\r\n text1.fontSize = 120;\r\n text1.fontWeight = \"bold\";\r\n text1.text = \"0 fps\";\r\n // text1.transformCenterX = 10;\r\n // text1.horizontalAlignment = 10;\r\n // text1.verticalAlignment= -100;\r\n // text1._moveToProjectedPosition(new BABYLON.Vector3(0,1,1));\r\n advancedTexture.addControl(text1);\r\n // text1.linkOffsetY = 1;\r\n // run the render loop\r\n engine.runRenderLoop(function () {\r\n scene.render();\r\n // divFps.innerHTML = engine.getFps().toFixed() + \" fps\";\r\n text1.text = engine.getFps().toFixed() + \" fps\";\r\n });\r\n // Initialize IFC loader\r\n var ifc = new IFCLOADER.IfcLoader();\r\n ifc.initialize();\r\n // Set up drag and drop for loading files\r\n filesInput.onProcessFileCallback = (file, name, extension) => {\r\n console.log(\"Reading file: \" + name);\r\n file.text().then(buf => {\r\n // delete existing objects\r\n try {\r\n this.mesh.dispose();\r\n }\r\n catch (_a) {\r\n //\r\n }\r\n this.mesh = ifc.load(name, buf, scene, true).then(() => {\r\n console.log(\"Done processing file: \" + name);\r\n });\r\n });\r\n return true;\r\n };\r\n filesInput.monitorElementForDragNDrop(canvas);\r\n // add the canvas/window resize event handler\r\n window.addEventListener('resize', function () {\r\n engine.resize();\r\n });\r\n var buffer = test_ifc_1.default;\r\n this.mesh = yield ifc.load(\"Sample model\", buffer, scene, true);\r\n });\r\n }\r\n}\r\nvar app = new App();\r\napp.createContent();\r\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly93ZWItaWZjLWJhYnlsb24vLi9zcmMvYXBwLnRzPzA2NmUiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7Ozs7QUFBQSxzR0FBMkM7QUFDM0MsZ0dBQXNDO0FBQ3RDLHNHQUFpQztBQUNqQywrRUFBeUM7QUFDekMsMkVBQW1DO0FBRW5DLE1BQU0sR0F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iAgICAgICAgICAgIC8vIC8vIFNldCBsaWdodCBpbnRlbnNpdHkgdG8gYSBsb3dlciB2YWx1ZSAoZGVmYXVsdCBpcyAxKS5cclxuICAgICAgICAgICAgLy8gbGlnaHQuaW50ZW5zaXR5ID0gMC45O1xyXG4gICAgICAgICAgICAvLyBkb3dubGlnaHQuaW50ZW5zaXR5ID0gMC44O1xyXG5cclxuICAgICAgICAgICAgLy8gUmV0dXJuIHRoZSBjcmVhdGVkIHNjZW5lXHJcbiAgICAgICAgICAgIHJldHVybiBzY2VuZTtcclxuICAgICAgICB9XHJcbiAgICAgICAgLy8gY2FsbCB0aGUgY3JlYXRlU2NlbmUgZnVuY3Rpb25cclxuICAgICAgICB2YXIgc2NlbmUgPSBjcmVhdGVTY2VuZSgpO1xyXG5cclxuICAgICAgICAvLyBDcmVhdGUgYSBkZWZhdWx0IGVudmlyb25tZW50IGZvciB0aGUgc2NlbmUuXHJcbiAgICAgICAgY29uc3QgZW52ID0gc2NlbmUuY3JlYXRlRGVmYXVsdEVudmlyb25tZW50KHtcclxuICAgICAgICAgICAgY3JlYXRlU2t5Ym94OiBmYWxzZVxyXG4gICAgICAgIH0pO1xyXG5cclxuICAgICAgICAvLyBoZXJlIHdlIGFkZCBYUiBzdXBwb3J0XHJcbiAgICAgICAgaWYgKGVudiAhPSBudWxsKSB7XHJcbiAgICAgICAgICAgIGNvbnN0IHhySGVscGVyID0gc2NlbmUuY3JlYXRlRGVmYXVsdFhSRXhwZXJpZW5jZUFzeW5jKHtcclxuICAgICAgICAgICAgICAgIC8vIGZsb29yTWVzaGVzOiBbPEJBQllMT04uQWJzdHJhY3RNZXNoPmVudi5ncm91bmRdLFxyXG4gICAgICAgICAgICAgICAgZGlzYWJsZURlZmF1bHRVSTogZmFsc2VcclxuICAgICAgICAgICAgfSlcclxuICAgICAgICB9XHJcbiAgICAgICAgZWxzZSB7XHJcbiAgICAgICAgICAgIGNvbnNvbGUubG9nKCdXZWJYUiBlbnZpcm9ubWVudCBp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pbGU6IFwiICsgbmFtZSk7XHJcbiAgICAgICAgICAgIGZpbGUudGV4dCgpLnRoZW4oYnVmID0+IHtcclxuICAgICAgICAgICAgICAgIC8vIGRlbGV0ZSBleGlzdGluZyBvYmplY3RzXHJcbiAgICAgICAgICAgICAgICB0cnkge1xyXG4gICAgICAgICAgICAgICAgICAgIHRoaXMubWVzaC5kaXNwb3NlKCk7XHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICBjYXRjaCB7XHJcbiAgICAgICAgICAgICAgICAgICAgLy9cclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgIHRoaXMubWVzaCA9IGlmYy5sb2FkKG5hbWUsIGJ1Ziwgc2NlbmUsIHRydWUpLnRoZW4oKCkgPT4ge1xyXG4gICAgICAgICAgICAgICAgICAgIGNvbnNvbGUubG9nKFwiRG9uZSBwcm9jZXNzaW5nIGZpbGU6IFwiICsgbmFtZSk7XHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICApO1xyXG4gICAgICAgICAgICB9KTtcclxuICAgICAgICAgICAgcmV0dXJuIHRydWU7XHJcbiAgICAgICAgfTtcclxuXHJcbiAgICAgICAgZmlsZXNJbnB1dC5tb25pdG9yRWxlbWVudEZvckRyYWdORHJvcChjYW52YXMpO1xyXG5cclxuICAgICAgICAvLyBhZGQgdGhlIGNhbnZhcy93aW5kb3cgcmVzaXplIGV2ZW50IGhhbmRsZXJcclxuICAgICAgICB3aW5kb3cuYWRkRXZlbnRMaXN0ZW5lcigncmVzaXplJywgZnVuY3Rpb24gKCkge1xyXG4gICAgICAgICAgICBlbmdpbmUucmVzaXplKCk7XHJcbiAgICAgICAgfSk7XHJcbiAgICAgICAgdmFyIGJ1ZmZlcjpzdHJpbmcgPSBzYW1wbGVJZmM7XHJcbiAgICAgICAgdGhpcy5tZXNoID0gYXdhaXQgaWZjLmxvYWQoXCJTYW1wbGUgbW9kZWxcIiwgYnVmZmVyLCBzY2VuZSwgdHJ1ZSk7XHJcbiAgICB9XHJcbn1cclxudmFyIGFwcCA9IG5ldyBBcHAoKTtcclxuYXBwLmNyZWF0ZUNvbnRlbnQoKTsiXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./src/app.ts\n"); /***/ }), diff --git a/src/IfcLoader.ts b/src/IfcLoader.ts index ea843d9..86843ca 100644 --- a/src/IfcLoader.ts +++ b/src/IfcLoader.ts @@ -17,28 +17,19 @@ export class IfcLoader { await this.ifcAPI.Init(); } - async load(name, file, scene) { + async load(name, file, scene, mergematerials) { var scope = this; await this.ifcAPI.Init(); - return this.parse(name, file, scene); - } - - async parse(url, buffer, scene) { var mToggle_YZ = [ 1, 0, 0, 0, 0, -1, 0, 0, 0, 0, -1, 0, 0, 0, 0, -1]; - var modelID = await this.ifcAPI.OpenModel(url, buffer); + var modelID = await this.ifcAPI.OpenModel(name, file); await this.ifcAPI.SetGeometryTransformation(modelID, mToggle_YZ); - var result = this.loadAllGeometry(modelID, scene); - return result; - } - - async loadAllGeometry(modelID, scene) { var flatMeshes = this.getFlatMeshes(modelID); var mainObject = new BABYLON.Mesh("custom", scene); @@ -46,19 +37,12 @@ export class IfcLoader { for (var i = 0; i < flatMeshes.size(); i++) { var placedGeometries = flatMeshes.get(i).geometries; for (var j = 0; j < placedGeometries.size(); j++) { - const mesh = this.getPlacedGeometry(modelID, placedGeometries.get(j), scene, mainObject) - // if (mesh != null) { - // mesh.name = flatMeshes.get(i).expressID.toString(); - // mesh.parent = mainObject; - // } + const mesh = this.getPlacedGeometry(modelID, placedGeometries.get(j), scene, mainObject, mergematerials) } } console.log("Materials: " + this.meshmaterials.size); console.log("Meshes: " + mainObject.getChildren().length); - // mainObject.getChildren().forEach(element => { - // console.log(element.name); - // }); return mainObject; } @@ -68,7 +52,7 @@ export class IfcLoader { return flatMeshes; } - getPlacedGeometry(modelID, placedGeometry, scene, mainObject) { + getPlacedGeometry(modelID, placedGeometry, scene, mainObject, mergematerials) { var meshgeometry = this.getBufferGeometry(modelID, placedGeometry, scene); if (meshgeometry != null) { var material = this.getMeshMaterial(placedGeometry.color, scene); @@ -91,7 +75,7 @@ export class IfcLoader { let color = placedGeometry.color; let colorid:number = (color.x+(color.y)*256+(color.z)*256**2+(color.w)*256**3).toFixed(0); - if (this.meshmaterials.has(colorid)) { + if (mergematerials && this.meshmaterials.has(colorid)) { var tempmesh: BABYLON.Mesh = this.meshmaterials.get(colorid); // console.log("Adding new mesh " + meshgeometry.name + " to mesh: " + tempmesh.name); meshgeometry.material = tempmesh.material; @@ -102,7 +86,6 @@ export class IfcLoader { } else { - console.log("Adding material with id: " + colorid.toString(16)); var newMaterial = this.getMeshMaterial(color, scene) meshgeometry.material = newMaterial; diff --git a/src/app.ts b/src/app.ts index a17e75c..8693d00 100644 --- a/src/app.ts +++ b/src/app.ts @@ -114,7 +114,7 @@ class App { catch { // } - this.mesh = ifc.load(name, buf, scene).then(() => { + this.mesh = ifc.load(name, buf, scene, true).then(() => { console.log("Done processing file: " + name); } ); @@ -129,7 +129,7 @@ class App { engine.resize(); }); var buffer:string = sampleIfc; - this.mesh = await ifc.load("Sample model", buffer, scene); + this.mesh = await ifc.load("Sample model", buffer, scene, true); } } var app = new App();