Script to connect points together to a curve?

Next
 From:  bemfarmer
6445.1 
Are there any comments about making a script to connect together a bunch of points, input by say an IGES file.
Assuming that the points were grouped in a few different, separated, "curves," order is not known, and the points are to be connected by
a "nearest neighbor" algorithm? It would be like automating the freeform control point or through point curves.

- Brian
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Michael Gibson
6445.2 In reply to 6445.1 
Hi Brian, well if you have a whole lot of points the nearest neighbor search can be quite time consuming. It can be sped up using certain kinds of data structures such as a K-d tree: http://en.wikipedia.org/wiki/K-d_tree. If you don't have a whole lot then a more simple search like the one used here may be ok:
http://moi3d.com/forum/messages.php?webtag=MOI&msg=2749.56

The best reference that I think I've seen before on K-d trees is:
The Design and Analysis of Spatial Data Structures by Hanan Samet

- Michael
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  bemfarmer
6445.3 In reply to 6445.2 
Thank you Michael.
A person on Geomagic forum had an IGES with ~5000 points, for, I think, a repair part. I loaded it up in MoI and did point export to csv/text file,
which some may still be pondering :-) (Curves would have been nice...)
I did explain the MoI usage and value.

Maybe I'll do some learning research...

- Brian
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Michael Gibson
6445.4 In reply to 6445.3 
Hi Brian, 5000 points is starting to get a bit large for the more simplistic "for each point look at every other point" type of processing, although it might be possibly just within range. The problem with the simple comparison method is that you end up doing an O(n^2) amount of processing.

With the K-d tree method, you build a tree structure that's set up in such a way that you can eliminate a whole bunch of points at each step rather than having to individually visit every single one.

I guess by Geomagic you're meaning the Alibre part of the new wide Geomagic "brand" ? Because the stuff that originally came from Geomagic itself was all very much geared towards reverse engineering point cloud data...

- Michael
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  bemfarmer
6445.5 In reply to 6445.4 
I meant "Geomagic Design" formerly known as Alibre.

Will investigate the K-d trees.

- Brian
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
 From:  bemfarmer
6445.6 
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged
 

Reply to All Reply to All