Removing connected vertices within distance of selection in geometry nodes

Given a selection of vertices (ie, a boolean that distinguishes certain vertices from others), how can I get all neighbouring vertices from the selection within a certain distance? The 2 vertices pointing to in the diagram have an attribute set to 1.

Ultimately I want to remove all the other vertices nearby (that don’t have an attribute of 1) within a certain distance (e.g. 0.0001) of these vertices:

tl8Pu1ZdXZ

^ Vertices are represented as red dots.
The vertices on the tip (corner) are already selected.
Probably ignore the ‘merge by distance’ text in the image - ideally I’d just delete them from the geometry. A merge would not be appropriate as I need those corner vertices to stay in place.

You’ll have to do it for each corner separately, but using “merge at last” with the tip selected as the active vertex and the other vertices on that corner selected will make all the extra vertices merge to the corner vert.

Alternatively, selecting the vertices you want to be deleted and using “dissolve vertices” will delete them while keeping the edge intact.

The op seems to want a geonodes solution.

Ah, fair enough. I’ll be no help with that, then.

You can’t dissolve vertices in geo nodes.

But you can still achieve same result with merge by distance node with this setup

7 Likes

Works perfectly.
Thank you so much!

1 Like