boxDummyGeo = {
const box3 = new THREE.Box3();
box3.setFromPoints(positionsArray);
const dimensions = new THREE.Vector3().subVectors(box3.max, box3.min);
const boxDummyGeo = new THREE.BoxBufferGeometry(
dimensions.x,
dimensions.y,
dimensions.z
);
const matrix = new THREE.Matrix4().setPosition(
new THREE.Vector3().addVectors(box3.min, box3.max).multiplyScalar(0.5)
);
boxDummyGeo.applyMatrix(matrix);
boxDummyGeo.matrixWorldNeedsUpdate = true;
const mesh = new THREE.Mesh(
boxDummyGeo,
new THREE.MeshBasicMaterial({ color: 0x00ff00, wireframe: true })
);
scene.add(mesh);
return mesh;
}