I have several primitive objects enclosed by one another in my scene. Mostly, BoxGeometry and Cylinders.
And I have clipping planes in multiple axes (xy, xz, yz), which are dynamically moved by the user.
When a clipping plane intersects an outer mesh, the vertices outside the normal plane are removed automatically.
But at the same time, since the outer geometry is hollow, this in turn shows other meshes which are contained inside to be visible.
I tried using a fragment shader technique which has been discussed in the following threads, but without any success.
Have attached a jsFiddle to better understand the problem as well.
Any help would be greatly appreciated. Thanks in advance.
this is quite hard, there is a way using clipping planes and stencils but imo in the end the code was more complex than just using csg. clipping caps - CodeSandbox
i had a small demo using clipping + stencil, but don’t seem to find it no longer. :-S