Jump to content

points refuse to get sorted by X! (hip attached)


Recommended Posts

I've got these points that don't seem to want to listen:

I wanted to sort them in the x axis, so the 0 is to the left and the highest point number is on the right of the x axis, and the same applies to the first half of points and 2nd half of points.

I have placed some colored spheres to visualise and realised my lovely points don't seem care about the sort node (Sort, point By X, couldn't be clearler), or am I doing something wrong that confused them?

I would have expected the left side is all red and the right side is all green.

Screenshotfrom2026-01-1021-44-42.thumb.png.22a1d2fc62ffa77449ff2eea1b9d6ca8.png

sortingbyX.hiplc

Link to comment
Share on other sites

Hi !
You can use the .12 icon to the right of the viewport to see your point numbers.
 image.thumb.png.72c47941b4e8f610b5f52379b0b45962.png

As you can see, your points are properly increasing. In other words - your sort node works as you intend.
You can bypass your sort node to see what the point numbers would be otherwise.

The issue is with the logic in your split2 node.

0-`npoints(opinputpath(".",0))`:2

You're saying to keep all points from 0 to 999, but take one point out of two.
This does give half the amount of points, but it takes 0, 2, 4, 6, 8, ..., 990, 992, 994, 996, 998
If you look at where 990, 992... are in the above screenshot, they're on "the wrong side".

Instead, you want to take the points from 0 to 499, like so

0-`npoints(opinputpath(".",0))*0.5`

You can simplify this like so

0-`npoints(0)*0.5`

image.thumb.gif.edbfd2dbaa3fbc0b696bf67a7d519819.gif

Then coloring your points will give the expected result.
image.png.bf413fd96ff18527d498f5d888302800.png

 

sortingbyX_fixed.hiplc

Edited by Alain2131
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...