How to Transfer the Same Group ID to Points Between Two Similar IDs in Geometry Nodes?

Hello,

I have a set of curves where groupID is assigned to different points.

Goal:
I need to transfer the same groupID to every point between two consecutive points that share the same nonzero groupID.

Problem:
How can I ensure that every point between two points with the same groupID > 0 receives the same groupID?

What would be some possible approch in Geometry Nodes to achieve this?

Thanks!

group_id.blend (605.1 KB)

There is a quick resum of the actual setup :

The IDs are assigned to the control points of the base curve based on the point indices (using index/2 modulo 4 to get pairs).

The curves are then split at the control points and resampled, resulting in many additional points in these curves, but they all have an ID of 0.

I think I got it working :

I’m not especially proud of the solution, but it’s better than nothing…

Something annoying is that at the end of your tree you have something like that :

So basically what I did is to first convert from mesh to curve so I can use the sample curve node…

Then we sample corner_groupID for each spline and store than on each point…
But we need to make sure corner_groupID is the same at the beginning and end of each spline.

And in fact, this fixes that issue completely :

So each segment is completely zero-ed when needed :

I’d be surprised if there wasn’t something much simpler to get to that result, but at least it works and later you might find a way to make it more simple :slight_smile:

3 Likes

Very nice workaround thank you!

Don’t worry this is exactly the result we wanted to achieve! If the result is good and corresponds, then the method is good!

Oh, don’t worry, I think your method is already pretty good. To be honest I’ve already broken my head and the ideas I’ve come up with have been more complicated and less suitable! Thanks again

1 Like