From 4c5af75d66cb3132b28c50c2209e77f76815ebf7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20P=2E?= Date: Wed, 4 Dec 2024 09:21:40 +0100 Subject: [PATCH] Messing with the clipper --- bim.js | 13 ++++++++++++- index.html | 4 ++-- main.js | 7 +++++-- ui.js | 3 ++- 4 files changed, 21 insertions(+), 6 deletions(-) diff --git a/bim.js b/bim.js index 3b97eda..7b81347 100644 --- a/bim.js +++ b/bim.js @@ -30,7 +30,6 @@ BIM.init = function (container) { } /** * @param {HTMLElement} container The scene container element - * @returns {OBC.Components} */ BIM.createScene = function (container) { this.init(container); @@ -42,6 +41,18 @@ BIM.createScene = function (container) { // (zoom_level, position) this.world.camera.controls.setLookAt(15, 15, 15, 0, 0, 0); } +/** + * @param {HTMLElement} container The scene container element + */ +BIM.activateClipper = function () { + const casters = this.components.get(OBC.Raycasters); + casters.get(this.world); + // Enable plane clipper + const clipper = this.components.get(OBC.Clipper); + clipper.enabled = true; + clipper.create(this.world); + clipper.visible = true; +} /** * @todo Serve web-ifc.wasm locally via AJAX * @param {ArrayBuffer} buffer The uploaded IFC file diff --git a/index.html b/index.html index f051a49..df2c0b7 100644 --- a/index.html +++ b/index.html @@ -35,7 +35,7 @@
-
+