6
$\begingroup$

In geometry nodes, I need to be able to select dynamically those vertices of a given grid of X by Y that are not positioned on the outside border of the grid... that is, if for example you have a grid of 4 by 4 vertices (16 in total) I need to be able to select procedurally vertices 6,7 and 10,11. ANy suitable nodes for doing this?

$\endgroup$

3 Answers 3

5
$\begingroup$

If this is a standard-issue GN-generated grid, you could wrap the Mesh Primitive > Grid node, in some way like this, to make an Indexed Grid group, which might come in handy elsewhere, too:

enter image description here

.. it associates a (zero-based) X and Y index with each vertex. In this version, I've passed the vertex-counts on, out of the group, because it's important that they remain integers, and Floor-ing a common input to guarantee that, takes more nodes, and creates spaghetti.

Once you have X and Y indices, you can use them in some way like this, to select the vertices not on the edges of the grid:

enter image description here

..dynamically:

enter image description here

There are plenty of other ways to discriminate. You could compare X and Y locations of points to the Bounding Box of the grid, or you could use a pure distance-from-rectangle function and measure lengths. The Indexed Grid method emphasises being able to select rows and columns in any way you like.

$\endgroup$
2
  • 1
    $\begingroup$ I like how you wrapped the mesh to get X and Y indices. I think that the group output for 'X index' and 'Y index' should be integers instead of floats, or would that cause a problem? $\endgroup$
    – Ethan-Hall
    Dec 16, 2021 at 18:39
  • $\begingroup$ @Ethan-Hall Oops! You're absolutely right! That was the whole point! Will fix. Thank you :D $\endgroup$
    – Robin Betts
    Dec 16, 2021 at 18:41
3
$\begingroup$

you can use this nodegroup:

enter image description here

to get this:

enter image description here

$\endgroup$
3
$\begingroup$

I believe this is the group of nodes you need.

A node tree example showing how to obtain a selection of interior grid points

$\endgroup$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .