If you have a large amount of points and you need to solve them
quickly, you'll have to find a way to speed up the closest-point-
search. Sorting points along x will allow you to binary search for
specific points and also to limit the search radius significantly. Or
you could store points in a grid of rectangles, so you can limit your
search to only those points contained within nearby rectangles.

Are you having performance issues?

--
David Rutten
[email protected]
Robert McNeel & Associates



On Apr 9, 1:21 pm, David Rutten <[email protected]> wrote:
> It's not such a bad idea. I uploaded a VB component that works in this
> exact same way, except it sets points to null instead of removing them
> from the list.
>
> http://groups.google.com/group/grasshopper3d/web/PointSearchVB.zip
>
> --
> David Rutten
> [email protected]
> Robert McNeel & Associates
>
> On Apr 9, 6:16 am, autarchy <[email protected]> wrote:
>
> > Im writing a VB script at the moment that:
>
> > selects a point (tPt) in ptList checks distance to each other point in
> > ptList to find the nearest neighbour (nnPt), adds nnPt to tempList,
> > remove nnPT from ptList and finds the next nearest neighbour (nnPt2),
> > adds nnPt2 and itself to tempList, removes nnPt2 and itself from the
> > list and then does the process again until the ptList < 3
>
> > I know this is a very cumbersome way to do this and have been looking
> > at other methods but to no avail.  Is there any other more efficient
> > way of doing this in VB?
>
> > Thanks,
>
> > :D

Reply via email to