From 4eab2bdcbc2d35249159996f34cdcad75c1d3b3e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20P?= Date: Fri, 6 Dec 2024 19:16:26 +0100 Subject: [PATCH] Solve clipper issue --- bim.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/bim.js b/bim.js index 7b81347..b88af34 100644 --- a/bim.js +++ b/bim.js @@ -33,13 +33,13 @@ BIM.init = function (container) { */ BIM.createScene = function (container) { this.init(container); - - this.world.scene.setup(); // Add a grid to the scene const grids = this.components.get(OBC.Grids); const grid = grids.create(this.world); // (zoom_level, position) this.world.camera.controls.setLookAt(15, 15, 15, 0, 0, 0); + + this.world.scene.setup(); } /** * @param {HTMLElement} container The scene container element @@ -91,6 +91,10 @@ BIM.loadIfc = async function (buffer, name) { model.name = name; this.world.scene.three.add(model); + for (const fragment of model.items) { + this.world.meshes.add(fragment.mesh); + } + // Useful? this.fragments = fragments; this.model = model; @@ -140,4 +144,4 @@ BIM.setupHighligther = async function (model) { this.highlighter = highlighter; } -export default BIM; \ No newline at end of file +export default BIM;