Change vertex number to point number

   3300   4   0
User Avatar
Member
22 posts
Joined: Oct. 2021
Offline
This might be a very easy problem to solve, but I just can't think of the solution. All I want to do is to just change the vertex number according to the point number. So, for example, in the following attached spreadsheet, I have vertex 0:0 and 0:1 with point number 1 and 0 respectively. I want to change the vertex number so that point number 0 would have vertex 0:0 and point number 1 would have vertex 0:1. I don't want to change the point number as they are in the correct position. Thanks is advance!

P.S. This is a moving point, and their vertex number keeps changing. So, using a reverse SOP would not fix the problem.
Image Not Found
Edited by martinalex - Dec. 4, 2022 03:54:25

Attachments:
Screenshot 2022-12-04 154044.png (2.2 KB)

User Avatar
Member
9380 posts
Joined: July 2007
Offline
Vertex order depends on the topology of your geometry

You can use Rewire Vertices SOP to attach vertices to specific points using an attribute value

Which would obviously change the topology, so it really depends on why you need to do this

Since chances are you don't unless you are really after changing the topology of your geo
Tomas Slancik
CG Supervisor
Framestore, NY
User Avatar
Member
22 posts
Joined: Oct. 2021
Offline
tamte
Vertex order depends on the topology of your geometry

You can use Rewire Vertices SOP to attach vertices to specific points using an attribute value

Which would obviously change the topology, so it really depends on why you need to do this

Since chances are you don't unless you are really after changing the topology of your geo

Hi Tamte! Thank you for the reply. I tried your solution, however, it seems that the problem still occurs. Perhaps, it is better for me to explain on what I want to achieve first. So, what I did here is that I used Boolean SOP on a given geometry (object_merge3) with a Grid. I used the abseams from the boolean operation to get the polyline on which later I would use the Sweep SOP to create a box. However, if I move the grid position, sometimes the vertex order changes. That is why I need a consistent vertex order so that I do not need to keep manually reverse the cross sections from the sweep node.

Attachments:
2.png (395.2 KB)
3.png (454.9 KB)
1.png (70.9 KB)

User Avatar
Member
9380 posts
Joined: July 2007
Offline
I don't see why wouldn't rewiring work in your case
since you are saying that the point numbers are in order as you expect

do this in Vertex Wrangle:
i@rewire_to = @vtxnum;
and then append Rewire Vertices SOP

assuming you have an open curve with same amount of points, then it should reorder vertices exactly based on point order
if you need to handle closed curves etc it's just a little bit more code, but should be straightforward

But if you tried this and it doesn't work for you post a file rather than screenshots
Tomas Slancik
CG Supervisor
Framestore, NY
User Avatar
Member
22 posts
Joined: Oct. 2021
Offline
tamte
I don't see why wouldn't rewiring work in your case
since you are saying that the point numbers are in order as you expect

do this in Vertex Wrangle:
i@rewire_to = @vtxnum;
and then append Rewire Vertices SOP

assuming you have an open curve with same amount of points, then it should reorder vertices exactly based on point order
if you need to handle closed curves etc it's just a little bit more code, but should be straightforward

But if you tried this and it doesn't work for you post a file rather than screenshots

Ah, my apologies. It would appear that I misused the Rewire Vertices SOP. Yes, it is working properly now. Thank you so much for the help.
  • Quick Links