# Thread: Automatic Polyline from Points LISP (need)

1. ## Automatic Polyline from Points LISP (need)

Registered forum members do not see this ad.

Hi everybody,
this is my first post.

I need a Lisp to generate a polyline from existing points.
The polyline should be created from all the points at the edge of the cloud of points generated by a 3d scanner.
The points are in 3 dimensions, but they could be flatted to zero.

The polyline can be close or open: it does not matter.

Any idea?

dave

2. What is the order of points that the program should follow ?

3. This will get you started: Convex Hull

4. ## Re: Automatic Polyline from Points LISP (need)

Originally Posted by Tharwat
What is the order of points that the program should follow ?
Hi Tharwat,
if I understand your question, the order is not important: clockwise or counter-clockwise does not matter.
If there are many points on the space, I need to connect only the ones on the edge of the cloud. The points inside the cloud are not to be connected.

I've read the suggestion of Lee Mac. This image from the page of Lee Mac is what I need to do:
http://www.lee-mac.com/lisp/gifs/convexhull1.gif
(hope is not a problem to point to an external link!)
but I was not able to let the routine work properly.

Please take a look of attached image:
Automatic Polyline from Points LISP (A).jpg show the "cloud" of points.
Automatic Polyline from Points LISP (B).jpg is the "cloud" connected with a polyline.

Now the second problem: the points are not on the same Z position! Maybe first I've to move points on an average Z position, if I want to use polylines (otherwise I must to use 3dpolyline, of course).

Dave

5. ## Re: Automatic Polyline from Points LISP (need)

Originally Posted by Lee Mac
This will get you started: Convex Hull
Hi Lee Mac,
thank you for the tip.

As I wrote, I'm not able to use Convex Hull. I'm not so good with lisp .

I've tried to copy and paste the code in your page, with the usually "nil" at the command line...

How to use it?

Dave

As I wrote, I'm not able to use Convex Hull. I'm not so good with lisp .

I've tried to copy and paste the code in your page, with the usually "nil" at the command line...

How to use it?
You would first need to download & load (e.g. via AppLoad) the Convex Hull function from the download link at the top of the page; and then copy the code for Example Program 1 either to a .lsp file, or to the AutoCAD command-line. The command for the example program is then 'test1'.

However, given that your example images show the desired result is not entirely convex, this function will only get you part of the way there.

Lee

7. Registered forum members do not see this ad.

You need some form of a Boundary lisp I am struggling a bit at the image scale but it looks like you want two parallel lines formed from the strip of points.

Is there not cloud tools to do this ?