I want to move an edge loop (marked blue in the image below) along the x-axis. Is there a way to select an edge loop in Geometry Nodes?
-
1$\begingroup$ Do you want a solution to this specific scenario or to be able to select an arbitrary edge loop in an arbitrary mesh ? $\endgroup$– GorgiousCommented Mar 28, 2022 at 8:52
-
$\begingroup$ I imagine if I have the solution for this scenario, I might expand the idea across other projects. The problem is I don't have a fundamental idea of selecting an egde loop (or face loop for that matter.). Give me what you think is best to learn. $\endgroup$– Edward SerfonteinCommented Mar 28, 2022 at 8:57
4 Answers
In Geometry Nodes there is no node that says "Select this or that edge loop" as you know it when editing your mesh in Edit Mode.
...the only possibility you have with Geometry Nodes is to select the points or edges by their indices.
You have different ways to get to these indices, but it basically depends on the topology of the mesh.
If you use a mesh primitive like in this example, the matter is easily solved with a little logic, since the order of the points/edges is always continuous and traceable.
However, if you use a self-made or more complex mesh, this does not help you, because then the order of the indices is usually wildly jumbled, and thus no logical selection can be made. In this case you would have to check point by point whether the index meets your criteria or not.
Selection of edge loops in a grid:
In each case you have to find out or know how many points one of the two sides consists of, because only then you can select a certain row. Of course, this is different for rectangles and squares. With a rectangle you must know at least the number of points of one side, with the square the values result from the square root of the number of the total points:
With this value for the number of points of a side you can now create a selection.
Instead of tinkering with Modulo here, the simpler solution is to use Snap instead!
Snap "rounds the input value down to the nearest integer multiple of Increment ". Increment in this case is the number of rows.
Depending on which direction you want to select, you directly compare the index of the current point with the result of Snap, or multiply the index again by the number of rows and then compare:
This logic can be applied to all grids that are either rectangular or square and created with Geometry Nodes or that have continuous indices.
Here is the blend file:
-
-
$\begingroup$ The problem is not solved satisfactorily. I think I want to leave it open. $\endgroup$ Commented Apr 15, 2022 at 22:08
-
$\begingroup$ @EdwardSerfontein If this update doesn't help either, then there is a serious problem with your grid ;-) $\endgroup$– quellenform ♦Commented Apr 16, 2022 at 18:16
-
$\begingroup$ Thank you for the update. Very informative and well explained. I think I phrased my question wrong. These methods all do work. But they are complex and the effort does not justify the selection of a loop/s. I am aware that almost everything in geometry nodes requires more effort to do compared to traditional methods. I think loop selection sits at the extreme end. I was hoping someone would post a simpler means. Thanks again for your efforts. I do appreciate. $\endgroup$ Commented Apr 16, 2022 at 18:55
-
$\begingroup$ @EdwardSerfontein Geometry nodes don't offer a solution for every problem, of course. It is only one approach of many, and it always depends on how procedural you want to make your scene. btw: With Chris's answer you don't get a selection for an edge loop. ;-) ...So if this answer still doesn't answer your question, then it would be good if you could modify your question again. $\endgroup$– quellenform ♦Commented Apr 16, 2022 at 19:06
-
1$\begingroup$ I would not say it's tedious, I'd say it's a way to select specified vertices. This method becomes tedious only as the number of vertices in the mesh increases. Nevertheless, thank you for your contribution. I was however hoping for a different solution. $\endgroup$ Commented Mar 28, 2022 at 9:25
You could also combine both Quellenform and Chris's answers and move the edge loop using a Set Position node like Chris mentioned but also use Quellenform's edge loop node setup.