Jump to content

Sort Sop - Sort By Expression


Vormav

Recommended Posts

I have come across a case where it would be useful to sort my vertices based on the angle between either the x, y or z axis, and the edge formed by the vertice and some center point (usually (0,0,0)). In other words, vertices would be sorted in a circular pattern, so that I could safely pass a range of these vertices off to an Add SOP to get a new, clean poly.

Shouldn't be too big of a deal. I created a function that, given an axis to work off of, a center point, and the other point (the point being evaluated for the sort sop), returns that angle as a floating point number.

The part where I think I'm getting mixed up is with how I'm passing along each point in the sort expression to my function. Right now, I'm trying to pass the data into the expression using point(".", $PT, "P", 0), but is $PT the right variable to be using within the context of the sort expression?

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...