Cleaning up hidden mesh instances with geometry nodes

Hi, I’ve been playing with geometry nodes recently, and I’m finding it tricky to get an optimised mesh.

I’m generating a simple block terrain, however, the problem is the mesh instances build on top of each other. I attempted to use Boolean Union and proximity but that gives patchy results and also melts the CPU.

Is there a cleaner way to remove mesh instances which aren’t visible or a way to calculate two faces next to each other and remove them?

Attached is an image of the underside to show the problem

Hope that makes sense, thank you


There been something similar to your one question:

Thanks goorman, unfortunately, no luck. Tried both the geometry node setup and the python script. I noticed both rely on the mesh being realized. Ideally i’d like to remove the mesh instances before converting it to a whole model - if thats possible?

The geonode setup doesn’t work and the py script just crashes blender.

You can also try to use Checker Diselect. Maybe it’ll help you more or less

Check out also this one:
https://blender.stackexchange.com/questions/268525/deleting-faces-that-are-not-visible-from-certain-direction

I think this is work for @zeroskilz

Only way I can think of doing it is using the extrude:

It’s clumsy without loops and requires that you cut&paste the following node-group for each “snapped” level… 1/0.25=4 in this case:

This is just a quick&dirty solution… I’m sure there are better ways of doing this.

Good luck.

3 Likes

Perhaps using a displaced surface to instance blocks on it then duplicate it one time down?


If you know the dimensions of your blocks - and especially if they happen to be on a neat Cartesian grid, which yours seem to be - then you can check each instance to see if it’s surrounded by six neighbors in all of the +/- XYZ directions (or five, if you don’t care about the bottom level) and delete all of those that are, since those are the ones that can’t be seen. You can extend this if you want - to check for twenty-six neighbors if you care about the neighbors that share edges and vertices instead of just faces, for example.

As implemented, this method deletes instances that are already there, but a little clunkily; you may want to put this check on the points before you instance them, for example.
Delete blocks with too many neighbors - Geometry Nodes - 3.6 - 2023-05-16.blend (134.8 KB)

5 Likes

This is amazing thank you, it works perfectly! This is such an exciting workflow.

1 Like