# In Geo-nodes, How could I compare the position of points to each other on a single axis?

I feel this should be fairly straightforward, but I am struggling a bit.

Basically, I want to find out if a point has a point after it on a single axis.

For example, if four points are in a line on the X axis, Each point should return "True" except the final point.

I feel Geometry Proximity would work, but I cannot figure out how to use it to compare a point with the index of 1 to a point of an index of 2 procedurally. (working with a few thousand points).

Here is an example using code if that helps me make any more sense. Here I have a threshold value of 5, so basically if the position of the next point was more than 5 units away, it would return as false.

int currentPtNum = @ptnum
int neighborPtNum = currentPtNum + 1

if (point(0, "P", neighborPtNum).x - point(0, "P", currentPtNum).x <= 5.0) {
@value = 1
}

else {
@value = 0
}

My idea was to take the position of point 2 and subtract point 1 from it. But I cannot seem to be able to do that. Hopefully you fine folk may know of a way.

• What about using an Attribute Statistics node to get the largest value of X (for example), then a Capture Attribute node to tag points with a boolean based on the difference between point X and X_max if it is below a threshold ? Apr 22 at 11:54
• Hello and welcome Scouty, you may be inspired by this tutorial: youtube.com/watch?v=tj6ZZYO5qPY Apr 22 at 12:14