Point Cloud - what tree structure to use for selection in polygon?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I am making a tool to find all point cloud points inside a polygon.
I don't mean autocad point cloud points, but my own points in memory.
I have done K-D tree structures before to locate the triangles under a point fast, but this is like the reverse.
Normally this kind of task is handled with sorting the data by X and Y and then subdividing the set of data into left and right halves, then up and down halves, and so on until you get down to just one item per "leaf", if this is a tree.
All I can think of for helping find points in a polygon is to sort by X and Y, and use that to narrow down the points within the bounding box of the polygon. Then I was thinking cut that data set into vertical strips with every vertex in the polygon defining a vertical cut spot, so I have straight lines forming zones within that vert strip. Then analyze those zones to keep or discard points, like:
Now these approaches do not make use of a tree structure, just the data sorted by x and Y.
I can't think of a better way. Can anyone point me in a direction that is more efficient?
I have watched selection in progs like recap and its about instant.
Selection in Trimble business center and carlson P3D is a bit slower.
Maybe an adesk'er could comment on what kind of structure to study?
Something to flex their neurons before the weekend hits?
thx
internal protected virtual unsafe Human() : mostlyHarmless
I'm just here for the Shelties