# How do I get a selection of points, which don't have another point above them in a certain Z distance?

I'm doing some mesh to voxel geo nodes and want to transform a given mesh into a blocky shape. Then I only want to colorize the top layer of the blocks. That's where the problem begins:

How can I get (index independent) a selection of points, which don't have another point right above them? A certain Z distance should be the deciding factor here (if possible).

Or is there a way to do it with texture coordinates, which look for the top most face and color the mesh from it's given Z coordinate and downwards?

I have been searching it for the past hour and been trying some things by myself, but no solution found so far.

Is this even possible?

Appreciate any help Rather than first spawning cubes, then coloring them, I'm first spawning triangles, then spawning colored cubes based on the topology.

The topology here means the logic between cubes, and more specifically, how much space is above any given cube - raycasting is used for that; here at least 4 empty cube-spaces are required for the grass to grow:  • Now this is insanity. Absolutely love this solution. Thank you so much <3 Nov 19, 2022 at 11:35

you can try it with this node setup: The "trick" is here to instance curve lines. And with endpoint selection you can identify the start and end points.

result: video tutorial: https://youtu.be/ZleGuOP3Rpk