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).
sort by relative point proximity
5267 5 2- markerline
- Member
- 245 posts
- Joined: Sept. 2008
- Offline
- keyframe
- Member
- 1529 posts
- Joined: July 2005
- Offline
- markerline
- 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?
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?
- markerline
- 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.
- markerline
- Member
- 245 posts
- Joined: Sept. 2008
- Offline
- markerline
- Member
- 245 posts
- Joined: Sept. 2008
- Offline
-
- Quick Links