1
$\begingroup$

I have a closed line of connected vertices without faces in GN. This is the outline of a road which I'm using to create a guard rail along the sides. I need to delete the end edges so the rail won't run across the road.

The closest I can come to it is making a selection of the corner vertices by edge angles. However deleting corner points/vertices doesn't work as they will also delete the last edge along the road (see animated gif). Converted to curve I could also make the corner selection but that didn't help either.

So how could I select/delete only the edges marked in red?

Node Setup Result of current setup

$\endgroup$
2
  • $\begingroup$ What about setting the Delete Geometry domain to Edge instead of Point ? $\endgroup$
    – Gorgious
    May 23 at 11:51
  • $\begingroup$ That gives unexpected results, deleting some edges, I don't understand based on what... I've uploaded the .blend so whoever wishes to try it don't have to reproduce everything from scratch. $\endgroup$
    – Booth
    May 23 at 12:54

2 Answers 2

1
$\begingroup$

This seems to work:

We do need to delete edges, not points, but your current node setup is built out to evaluate the field for each point. Just switching it to edges doesn't work and produces those strange results you mentioned.

So using the edge vertices node, I can get the indices of both vertices of any given edge. if your node tree evaluates to true for both vertices of a given edge, then we know to delete that edge with the and boolean math operator.

Hope this helps!

enter image description here

$\endgroup$
2
  • $\begingroup$ This works very well! I had the idea this would be the solution in theory but could not put together the setup, not knowing enough about how to access topology (the first part of my setup was also imported, not my own). $\endgroup$
    – Booth
    May 24 at 5:13
  • $\begingroup$ Could you perhaps replace the image of the node setup with a higher resolution one? It was very difficult to discern text on it. $\endgroup$
    – Booth
    May 24 at 5:16
0
$\begingroup$

This solution works by first selecting vertices that form an angle greater than the given value (87 degrees in this case), then extending the selection to neighbouring vertices 2 times and then subtracting from the selection 3 times. The points selected this way define the edges to be deleted.

The advantage of this method is that it will delete end edges even if there is an extra vertex on it (if the end edge is subdivided). That's exactly what happened in my case: my geometry is generated and soon I encountered a case where an end edge had a vertex on it and because of that Grant Thorshov's solution didn't work (even though it perfectly answers my original question and I'm grateful to him :)

The technique I used to extend/subtract vertex selection comes from this answer here: Geometry Nodes - Select More/Less

NodeSetup ThisWorks

$\endgroup$

You must log in to answer this question.

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