Is it possible to remove or cut away sections of shapes in Three.js?
For example, if I made a CylinderGeometry and wanted to "shave" the front of it away, so that the front was flat and the back was curved, like a half cylinder. Is this possible?
I need to be able to do it to the front and back of a cylinder, so just the sides are curved.
It is possible. You can deal with triangles yourself, or use Boolean operations with a library like Constructive Solid Geometry to do mesh subtraction.
Have a look here and here for some suggestions related to manipulating geometry.
There are other algorithms to slice a mesh that could be ported over, but it depends how simple or complex you need this thing to be.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With