|
Sorting points by coordinatesHi ! I guess I have posted yet a question quite similar in another topic. But I still have the same trouble... I would like to sort a stfucture of points so I can have a coherent shape at the end. I can't manage to do this. I tried to implement a connected component algorithm but it is terribly slow... Does anybody have an idea ? Thanks !
|
Sort patch? I guess you're looking for something more sophisticated… what do you want to sort by if not X, Y, or Z?
I've filtered a point structures to highlight only those points within a certain distance of currently selected point so I can jump to them with keystrokes. For small number of points <200 it's instantaneous from what I remember (I think I did it in JS patch).
Thanks Alastair for your answer.
I would like to have a kind of blob of an openCL structure of points. My OpenCL kernel treats the points before by width then by height, so my structure is sorted the same way.
In my plugin I sorted my points before by Y then by X ("connected components brute force method") but it is very slow and I guess there is a better way to do this... but I'm not skilled at this work...
I have around a hundred of points and I woud be very very very happy to see your JS patch ! :-D
Will dig it out tonight if I can. OpenCL — not my department… haha
:-D Thanks !
Okay I don't want to post the whole comp, partly because I used it make my avatar id image and partly because I can't find a fully functional file… dozens of iterations and all are only partially function in one area.
I have 286 points in my Geodesic dome (thanks Tangible Interactive for the data set). The javascript that selects the nearest points to any given point (inside a numeric limit) works as fast as my comp does anyway, about 14fps. This is the script:
The other script I'll post compares all the points with each other and plots chords between points that have a distance that falls inside a user definable range.
I probably should have passed 2 point vectors to the distance function not 3 scalars as result of subtractions but you can fix-up the niceties. I wrote this when I was struggling with JS patch parsing error concepts in QC. The second script takes a second to re-evaluate when you change one of the inputs on my old clunker (dual G5 PPC). OpenCL would tear this up in less than the blink of an eye for thousands of points I imagine.
Thank you so much Alastair !
What a deep work.
I'll try to tinker with the second one especially. It will be very useful for me !!!
I'll post the results (if there are).