# Delete faces of a mesh that are fully immerged into another one via Geometry Nodes

I want to remove faces that are enclosed by another object and not visible to save resources (I will apply modifiers and export the mesh).

Something like this:

The closest thing I've been able to achieve so far, and the closest thing to the result, is this:

However, this also deletes the overlapping faces, and I don't know how to keep them. I have an idea that this is possible, but I can't figure it out.

I want to avoid the Boolean method because it creates a bunch of extra vertices and I'm trying to keep their number low.

You are basically on the right way with your solution, however, you would have to consider the following things:

1. Use in the node Raycast as Ray Direction the normals of your points of the sphere.
2. Compare the normals you get at the output Hit Normals with the normals of your points. For this you use the node Compare and switch it to Vector, Dot Product and Greater Than $$0$$. This way you know which points are inside the cube.
3. Since these results are evaluated per point, but you only want to delete faces that are completely hidden, capture these inner points first with Capture Attribute in the point domain.
4. Finally, use Delete Geometry with these values, which will interpolate them to the face domain and select only those faces where all points of the face are inside the cube.

(Blender 3.2+)

• awesome, thank you very much! works like a charm!
– John
Jan 28 at 14:23
• Interesting cast .. captured as Boolean .. still 'fractionally' interpolates as True.. Jan 28 at 14:52
• @RobinBetts yes, I used that fact in my doo sabin coloring. Jan 28 at 18:16