sort by relative point proximity

   5267   5   2
User Avatar
Member
245 posts
Joined: Sept. 2008
Offline
I am trying to sort a set of points that define a polygonal circle. I have randomly sorted the point numbers based on the random tab in the Sort SOP. Now what I am trying to do is to sort them by radial order, perhaps using an expression in a second Sort SOP. But I don't know how to go about this. I have tried creating an id attribute and sorting by that but I see no change. I have also tried to sort by the expression cos($ID) and cos($PT) but no change.

How do I sort radially in order? Thanks in advance. (This also has to do with an idea I have for creating a quadrangulate procedure).
User Avatar
Member
1529 posts
Joined: July 2005
Offline
You might wanna try vertex order.

G
User Avatar
Member
245 posts
Joined: Sept. 2008
Offline
That works perfectly! Here are the steps for Quadrangulating a divided Torus:

1. Make Quad Poly (in my case a Torus)
2. Fuse Uniqe the points to individualize each face
3. Primitive Sop to scale down each face (separate them in prep for connectivity and partition sops)
4. Divide Sop to triangulate the faces
5. Fuse (disabled)
6. Connectivity Sop to add CLASS attribute to each connected face (pairs of triangles)
7. Partition Sop to create groups for pairs of triangles
8. Foreach SOP to a) sort the faces by vertex order and b) delete the inner edge that defines the triangles
9. Convert SOP to force poly creation in case the last sop evaluates to bad geometry
10. Primitive SOP to reverse invert/reverse the scaling from step 3
11. Fuse to make faces connected at vertices.


The Only problem is in the event that there are some face pairs that do not exist, in other words some faces on more complex geometry are only a single triangle. How would I create a condition that forces those triangles to be skipped in the foreach sop where the edge is deleted?

Attachments:
sort_and_quadrangulate.hip (98.8 KB)

User Avatar
Member
245 posts
Joined: Sept. 2008
Offline
as you can see in this second file the quadrangulate does not really work. In my case I do not know how to group pairs of faces and use a primitive sop to reduce the prim face scale. I would get prims that are scaled down but separated triangles and this is no good to use the connectivity sop. Let's see if anyone can add to this post because I think I have a good concept going but not the right knowledge about Houdini.

Attachments:
sort_and_quadrangulate_alt_not_working.hip (84.3 KB)

User Avatar
Member
245 posts
Joined: Sept. 2008
Offline
What I really need to be able to do is to group each pair of triangles that share the same normal direction down to a very small variance in normal direction. That way I can use pairs of triangles if the geometry is regular enough.
User Avatar
Member
245 posts
Joined: Sept. 2008
Offline
Here is a partially working solution using colors combined with normals to define partitions and connectivity

Attachments:
sort_and_quadrangulate_alt_is_working_3_partially.hip (119.9 KB)

  • Quick Links