Closed michaelhoehn closed 2 years ago
Here's a helpful reference for implentation of constructive solid geometries:
Code snippet:
const cylinderCSG2 = CSG.fromMesh(cylinderMesh2)
const cylinderCSG3 = CSG.fromMesh(cylinderMesh3)
const cylindersUnionCSG = cylinderCSG1.union(cylinderCSG2.union(cylinderCSG3))
const cylindersUnionMesh = CSG.toMesh(cylindersUnionCSG, new THREE.Matrix4())
cylindersUnionMesh.material = new THREE.MeshPhongMaterial({ color: 0xffa500 })
cylindersUnionMesh.position.set(2.5, 0, -3)
scene.add(cylindersUnionMesh)
Closing as was accomplished with Room Generator #3
The original algorithm constructed rooms using the following steps:
The original algorithm was written in Grasshopper for Rhino and should be adapted to threejs methods accordingly.