engine_components
engine_components copied to clipboard
Collision detect between ifc elements
Description 📝
I'm looking for a tool to detect all the collisions present on the model like on Bim Collab.
Model without filter:
Model with filter:
Suggested solution 💡
Actually i use Mesh.geometry.boundsTree.intersectsGeometry to check if a object is colliding with another, but only works comparing the meshes 1 by 1
const elementBase = parseInt(ifcItem.id);
const sub1 = getSubsetDataFromId(elementBase);
sub1.geometry.computeBoundsTree();
const sub2 = getSubsetDataFromIds(elementosIds);
const sub2Geometry = mesh2.geometry;
sub2Geometry.computeBoundsTree();
const transformMatrix = new Matrix4().copy(mesh1.matrixWorld).invert().multiply(mesh2.matrixWorld);
const hit = mesh1.geometry.boundsTree.intersectsGeometry(mesh2Geometry, transformMatrix);
Alternative ⛕
No response
Additional context ☝️
No response
Validations ✅
- [X] Read the docs.
- [X] Check that there isn't already an issue that requests the same feature to avoid creating a duplicate.
I'm actually looking for something similiar myself! I just started looking, but since there isn't an official implementation yet i guess our best bet would be using native Three.js methods to achieve the desired result.
Hey, you should check this out with Garret, as he is the author of the BVH library. We are not planning to implement clash detection features in our library for now (although you can do it yourself using Garret's and Three's APIs; our library just provides you with the InstancedMeshes you need and an easy way to manage them), so this issue is out of our scope. Cheers!