# Geonodes: How to get distance between points made of instances?

Hi!

I’ve spent some time today wondering how to get distance from individual points (converted from instances) and compare their location to location of individual parts of selected curve.

So, let’s say every instance in Collection 2 (and ideally all it’s subcollections as well) should be converted to points and those points’ location should be compared against location of each of those separated curves (which in fact make one object, BezierCurve).

Is that possible somehow? I struggle with instances, don’t understand them yet as I’d like to.

You can do it with “Instances to Points” node, but you need to have all instances in the same collection, the subcollections doesn’t work.

4 Likes

I need to explain myself better. I was trying to select curves as a whole.

So, in this example, if collection with all empties is selected, all curves except No. 2 should be deleted (or otherwise manipulated with other node). Curve No. 2 should stay intact.

It’s almost same setup as above, just add Greater Then node after Distance node and plug it into Separate Geometry node

1 Like

Thank you, it does now exactly what I needed!

1 Like

Well, I was wrong and it doesn’t work. I noticed it only compares the distance from the center, not individual instances/points.

If working correctly, it should delete all curve parts respectively, by the numbers.

But it still deletes them from the center instead.

Any ideas what I missed here?

You’re sampling the nearest point but then sampling the spline by index? What makes you think that’ll work?

Fixed it, but one strange thing (to me) is still occuring.

It now calculates distance from each instance/point, but also from 0 coordinates. Like there would any another, fifth instance. Not a big deal, but still undesirable.

Also, is there a way to not have all instances inside a single collection, but inside subcollections? While having instances in Col 3, Col 4, I could simply address Col 2 instead.