Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

getting an interpolation of a list of points

Status
Not open for further replies.

paulpatrick

Mechanical
Aug 27, 2005
49
0
0
GB
Is it possible to input a list of points via script and get AutoCAD to interpolate a nice smooth transition form one point to another? I have to have the smooth curve from one point to another as they are for a ship?
I dont want the usual stuff from AutoCAD where it generates a curve thats close to the points ..it has to be on them
My boss is using rhino to generate it and import it into CAD..
He said he was not aware of a function to generate it in CAD....
The rhino version hes got is old so there is no layer function in it. To make life easier and remove the guess factor I need the layers....
 
Replies continue below

Recommended for you

Create a polyline from the points, then edit the polyline with the the "fit" option, which creates a smooth fit through the points.

You could input the points via a script, such as;

polyline
x1,y1
x2,y2
x3,y3,
etc...
[blank line at end, to end the command]

Another way is to start the "pline" command, then copy and paste a point group from Excel or a text file into the command line.
 
Sorry mate no cigar for you .. It still does not make them hit the points ...just closer than earlier. I was not aware of the fit command for it ..so I learned something.
I did a dummy up test... the control points are the points I intended the line to go through but in spline it just makes the line go closer to em....
Need either a script or something that makes the line go through the line.
Would have thought AutoCAD had it all.. and not have to use Rhino
 
OK I was going on memory - there are 2 curve/fit options under "pedit". If "fit" didn't go through the points, try the other one, "curve" i think...
 
If you create a script file as CarlB suggested, but use _pline instead of polyline, I guarantee you, Autocad will hit all points exactly. But before you start the script you'll have to turn Object Snap off.
 
Occupant is correct but AutoCAD will join the points with straight line segments. I thought the OP was looking for a curve fitting routine that would use arc segments instead. To my knowledge AutoCAD will do that if you invoke the SPLNE command, set the first two points, then set the FIT TOLERANCE to zero and continue so set points.
 
I done the scripting a while ago .. .. we had a way of plotting a spline in a layer of it own... can someone remind me so I can help my mate now who wants to put in over a hundred points ..has it ready to roll in excel but does he have to have the command infront of each point or what...I could use an example of the scripting if anyone has some lying about!
I looked the that sites
 
I described one way in my first post above.

A little more detail, create a column of coordinates in Excel that has the x-y coordinates.
Formula in say col c would be:
=A1&","&B1

copy down for all cells/points.
In AutoCAD, start the "spline" command
Copy & paste entire column range of coordinates
then manually close the spline command with 2 "enters".

You could also do it with a script file, formatted as follows:

Spline
x1,y1
x2,y2
x3,y3
;;etc
;;2 blank lines to finish
 
I understand, you wanted to match the given points exactly. That's what the _pline or _3Dpoly (if you are in 3D) commands do. The only thing you can do afterwards is to use the _fit command on the thing to create arcs out of the straight line segments. If your given points do not represent a mathematically correct curve, the only thing you can do, in my opinion, is to use some regression algorithm on them to get them there. If the given points already represent a spline then, of course, you'll have to use the _spline command in your script file.
 
Status
Not open for further replies.
Back
Top