The task of making logical selections from a grid comes up quite a lot, and while it can be done case-by-case, it can get very repetitive. An 'Indexed Grid' group might make sense.
This group:
- Constructs a 1D,(line) a 2D, or a 3D (with internal vertices and edges) grid.
- Allows the number of divisions, and dimensions, to be set.
- Indexes the vertices by their [division number] in X,Y, and Z, from 0 to Count-1
- Returns whether the vertices are in the minimum or maximum planes in X,Y, and Z
- Also captures vertex-neighbour counts, which can be quite useful for some selections
It starts by making grid of unit cubes, covered for the edge-cases where the grid is 1 or 2D:
..and then incorporates that into an 'Indexed Grid' group which scales it to dimension, having captured the indices, max/min, and neighbour-counts:
There's nothing too interesting here, that couldn't be done case-by case, but it does take some of the slog out of doing it every time, and might be easier to play with, making selections, than rebuilding every time.
For instance, to select the corner columns you illustrate, first select all the points which are Max OR Min, by adding, and then find the ones for which that is true for X AND Y, by multiplying, as here, or by using the Boolean Math > AND node
Here are some selections based on the number of neighbours:
.. and the indices can be passed out to shaders: