Sort point anomalies

Hi All,
I am trying to use the sort points component to rationalise a data set. It mostly seems to work However, there are a few anomalies and I cannot for the life of me work out what is causing them.
In the screenshot below, the first three columns are ordered correctly but point 55 is out of sequence. My understanding is it should sort by x first (which it does fine) and then sort by y but in this case the sort by why is not correct.

Can anyone tell me if I am doing something stupid?

sort (592.1 KB)

all looks good, you’re doing nothing stupid :+1:

but :slight_smile:

don’t know if this might be relevant at all, if your points proxected on XY Plane are compared to those of an “equal perfect grid”, it looks like there’s some distance between points that should be coincident

sort (598.1 KB)

how was your point grid generated?

HI Inno,
Thanks for the reply, good spot!! I don’t understand why that would impact the sort order. However, pinching your ‘perfect grid’ bit of code seemed to fix the issue :thinking:.


well, that has a pretty straightforward explanation: let’s say the circled point at index 55 has a X value slightly bigger than all the other points that look like being on the very same column, then it means that point 55 does not belong to that column (sort by X, then sort by Y, then by Z)

we can test that, let’s take the X coordinate of point 55, compare it with X coordinate of point #42
if the difference is zero then they share the very same X coordinate, but if it’s “something” then they don’t share the very same coordinate

in this case it looks like there’s a super tiny difference in coordinate, so small that it doesn’t get visualized in a panel

this means that the way the X/Y coordinates of the point grid might have gone thorough some troubles :slight_smile:

another test, just for the sake of investigating the problem, if you trim the numeric values of the XYZ point-coordinates to just 3 decimals and sort them again, you will see the sorting looks perfect: