I’m looking for a way to be able to clip objects on each floor of the bim model. But it seems that clipping does it capitally even though the material can be replaced but not by cutting it.
Object.entries(obj.storeyMap).forEach(
([ifcBuildingStoreyName, subset]) => {
const mesh = subset as THREE.Mesh;
const boxHelper = new THREE.BoxHelper(mesh, 0xffff00);
// const bbox = new THREE.Box3().setFromObject(mesh);
const scene = threeManagerRef.current?.getScene();
if (
ifcBuildingStoreyName === '3 Floor' ||
ifcBuildingStoreyName === '1 Floor'
) {
const localPlane = new THREE.Plane(
new THREE.Vector3(0, -1, 0),
5,
);
const materialPlane = new THREE.MeshPhongMaterial({
side: THREE.DoubleSide,
transparent: true,
opacity: 0.5,
color: 0xffbbbb,
// ***** Clipping setup (material): *****
clippingPlanes: [localPlane],
clipShadows: true,
});
const helper = new THREE.PlaneHelper(localPlane, 10, 0xffffff);
mesh.material = materialPlane;
scene?.add(boxHelper, helper);
}
},
);