Jump to content

sorting point problem


cloudfx

Recommended Posts

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?

post-3325-0-90117800-1360005123_thumb.pn

Edited by cloudfx
Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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 by zarti
Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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 by magneto
Link to comment
Share on other sites

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

post-4520-0-49185700-1360049721_thumb.pn

post-4520-0-26515400-1360049731_thumb.pn

post-4520-0-16512900-1360049741_thumb.pn

Edited by xmetallicx
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...