cloudfx Posted February 4, 2013 Share Posted February 4, 2013 (edited) I have a shape with random point numbers. I want to sort the point number along the s-similar shape curve(which is not existing) from 41 ~ 28(in the picture's point number) to be 0 ~ npoint-1 Any preferences to work this out? Edited February 4, 2013 by cloudfx Quote Link to comment Share on other sites More sharing options...
tjeeds Posted February 4, 2013 Share Posted February 4, 2013 I believe you'll need curve, not just the points. Then you can sort by vertex number. Are you saying you can't get at that curve? Quote Link to comment Share on other sites More sharing options...
cloudfx Posted February 4, 2013 Author Share Posted February 4, 2013 I believe you'll need curve, not just the points. Then you can sort by vertex number. Are you saying you can't get at that curve? The problem is there is no curve. If I use Add sop to do Polygon, due to the random point number, its going to create random spiky curve. Quote Link to comment Share on other sites More sharing options...
acey195 Posted February 4, 2013 Share Posted February 4, 2013 you can sort on distance using a foreach loop, per loop you can make it to find the next closest point, each loop removing the points that are already connected. Quote Link to comment Share on other sites More sharing options...
zarti Posted February 4, 2013 Share Posted February 4, 2013 (edited) you can sort on distance using a foreach loop, per loop you can make it to find the next closest point, each loop removing the points that are already connected. that might not work always , imho . -- @cloudfx : a suggestion the screenshot shows only the points , but if you have the geometry ( primitive ) from which those points are coming , it might be easy by transferring prim's vertex numbers to the points ( attribtransfer_SOP ) . from there , sorting points should be easy , theoretically .. .cheers edit reason : typo =P Edited February 4, 2013 by zarti Quote Link to comment Share on other sites More sharing options...
tjeeds Posted February 4, 2013 Share Posted February 4, 2013 Is this something you're going to have to do over and over with tons of points? Cause if not I'd just buckle down, turn on point snapping and hook them up with a Curve SOP. Quote Link to comment Share on other sites More sharing options...
pclaes Posted February 4, 2013 Share Posted February 4, 2013 Or you make it semi-procedural, whereby you only create 4 approximation control points of the curve, then resample the curve, and attribute transfer the position of the points to the curve. This will snap the points of the curve for you. There might be some points of the curve snapping to the same point of the pointcloud and overlapping, so it might require some filtering (fusing, cleanup, resample). You could approach this in a similar fashion as a shrinkwrap. Start out with a basic curve with 4 points that you place yourself, then snap & resample, smooth, snap & resample, smooth, snap & resample. Quote Link to comment Share on other sites More sharing options...
magneto Posted February 5, 2013 Share Posted February 5, 2013 (edited) If it's 2d, I would do this: 1. Triangulate2d 2. Divide (Remove Shared Edges is on) 3. Convert (to NURBS Curve) 4. UVTexture (Uniform Spline) ( B ) 5. AttribTransfer from your points to B (Points: uv) 6. Sort (Expression: $MAPU) This should give you ordered points at least, but the start point is not controlled. Edited February 5, 2013 by magneto Quote Link to comment Share on other sites More sharing options...
xmetallicx Posted February 5, 2013 Share Posted February 5, 2013 (edited) Will this work for you? sort your point 0 to one end of the curve. then use another sort with proximity to point with an expression referencing that point 0' it does have its flaws but it might work for you Cheers! - Joel Edited February 6, 2013 by xmetallicx Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.