A few years ago a feature request on p5.js’ github asked about boolean 3d modeling – which was determined to be best added as a library. Researching the topic now with a student and that thread informed us about CSG, specifically the csg.js library – which is amazing, however unclear how to make this compatible with p5.js models and WEBGL geometry.
I’ve made an attempt with csg.js in this demo – which successfully displays the vertices, however doesn’t form a useful model that would allow texture or shaded fill on it. Curious if someone here has enough experience with p5.js + WEBGL + meshes/geometry for guidance on bringing the outputs of csg.js closer to what p5.js works with when importing an obj.
There’s a few brigdges out there for csg.js » three.js:
ThreeCSG, THREE-CSGMesh, threejs-csg, three-2-csg, more…
Maybe one of them can help solve the issue? End result – library/function/bridge to create custom solid 3d shapes with this library or similar.