2
$\begingroup$

I have bunch of points and they are overlapping (most common is 4 at the same coordinate). Is there a way to assign group index to all points sharing the same location?

$\endgroup$

1 Answer 1

3
$\begingroup$

You could sample the nearest index from a branch in which you have merged points by distance. Here ID is set, but you could just capture, instead:

enter image description here

Then all vertices less than Distance apart will share the same ID

(You could capture Accumulate Field > 'Total' with 1 as the field value, using ID as 'Group Index', to separate coincident points from the others)

$\endgroup$
6
  • 1
    $\begingroup$ Nice trick! I was thinking using modulo to define a unique integer for each cell of a 3D grid, but using a 32 bit integer that gives a resolution of $11×11×10$ bits or $2048×2048×1024$ grid cells. For 2 m × 2m × 1 m space a grid cell of 1 mm, not terrible but much worse as the space increases… $\endgroup$ Jul 17, 2023 at 11:49
  • $\begingroup$ @Markus .. and you've got the problem of same-cell-but-not-closest? This one, once again, relying on in-house BVH.. $\endgroup$
    – Robin Betts
    Jul 17, 2023 at 16:02
  • $\begingroup$ I have no problem, just saying I would solve this in a worse way. One could improve the cells algorithm to just list the cells used and then sort them, but gets very complex, most probably still slower than your solution, and one of optimizations might actually use merge by distance at some point... $\endgroup$ Jul 17, 2023 at 20:04
  • $\begingroup$ @Markus ahh .. sorry.. for: 'you've got', read: 'you would have' (hypothetical).. and we still don't know if it works for OP.. :) $\endgroup$
    – Robin Betts
    Jul 17, 2023 at 20:49
  • 1
    $\begingroup$ Hi @JosefLudvíkBöhm ! It looks as if you asked the wrong question, and this is a wrong answer, but they match :) IMO, the middle of a fix is there, and others can adapt it the way you have, so safe to call it good. ( But i'm biased, of course,) $\endgroup$
    – Robin Betts
    Jul 18, 2023 at 6:34

You must log in to answer this question.

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