Community
AutoCAD Forum
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Automatically calculate spline point

8 REPLIES 8
SOLVED
Reply
Message 1 of 9
Anonymous
1766 Views, 8 Replies

Automatically calculate spline point

Hello,

 

I have one existing spline. Attached excel file are co-ordinate data of existing spline. Image file also attached.

I need to create a new spline, point 1 is decided by distance to existing spline first point (in this picture it’s .280”)

End point is decided by distance to existing spline last point (in this picture it’s .800”)

 

I need to make new spline, that has same number of points with existing spline, and distance from new spline points to existing spline is gradually increase from .280” to .800”.

 

I usually manually create points, then make a construction line to existing spline point, activate handle to make it perpendicular, use dimension tool to increase distance gradually, finally create new spline from these calculated points.

 

This takes me lot of time. Also, when I need to change first point or end point distance (e.g: .800” change to .500”), I have to redo this process again.

Is there any way that I can automated this process? Either in excel or directly inside Inventor is OK with me.

Thanks for your time and advice.

 

Minh

 

Tags (1)
8 REPLIES 8
Message 2 of 9
john.vellek
in reply to: Anonymous

Hi @Anonymous,

 

To draw the linework from a script is fairly easy.  If you use the concatenate function in Excel to combine the point data,you can then copy and paste into a txt file that has "scr" as the file extension. Then use SCRIPT in AutoCAD to enter the data into your drawing file.

 

Capture.PNGThis can get your pline or spline drawn rather quickly.

 

For a more automated solution, you might check for some add-ins in the Autodesk App Store.


John Vellek


Join the Autodesk Customer Council - Interact with developers, provide feedback on current and future software releases, and beta test the latest software!

Autodesk Knowledge Network | Autodesk Account | Product Feedback
Message 3 of 9
leeminardi
in reply to: Anonymous

The attached Excel file enables you to create both the outside and inside splines.  

 

Column D contains the coordinates for the outside spline in the x,y format (similar to the post by @john.vellek ).  You do not need to make it a script. Just select cells  D3:D11 and type CTrl-C to copy it to the clipboard.  Go to AutoCAD and give the spline  command and then Ctrl-V to paste the coordinates and the outside spline will be created.

 

To determine the location of the points for the inside spline I started with the first and last points. The first point (#0 in my labeling) of the inside spline has the same x coordinate as the 1st point of the outside spline but its y value is 0.28 less.  Similarly, the last point of the inside curve has the same Y value as the last point of the outside point but its X value is 0.8 less.  See the contents of cells E3, F3, E11, and F11.

 

The challenge is to compute inside points 1 thru 7.  To determine the location of these points I inverted the slope between the two adjacent outside points to computer the location of the inside point. For example, the location of inside point #1 is determined by taking the slope between Point #0 and #2, inverting it and reversing its sign.  This generates a line perpendicular to the slope.  I then used similar triangle to determine both the x and y coordinates of the inside point.   You can see my intermediate calculations in columns H thru K

 

ss1.JPG

Just copy cells G3:G11 from Excel to AutoCAD (after giving the spline command) to create the inside spline.

ss2.JPG

 

 

 

 

lee.minardi
Message 4 of 9
Anonymous
in reply to: john.vellek

Thank you very much John.

Message 5 of 9
Anonymous
in reply to: leeminardi

Thank you very much leeminardi

I have not look details yet but the curve looks great and that's exactly what I need.

I will check details tomorrow.

 

Once again, thank you! This will save me huge amount of time.

 

Best regards,

Minh

 

Message 6 of 9
leeminardi
in reply to: Anonymous

Glad to have helped.

 

Please let me know if you have any questions regarding how I derived the equations for the inside spline.

 

Also, it should be noted that the slope of both curves is not 0 (horizontal) for either spline at the top of the curve.  If you plan to revolve the shape there will be a point at the top of the dome.  If you need a horizontal slope at the top there are a couple of ways to achieve this.

1. Enter the points in the reverse order (from bottom to top) and after specifying the last point enter a "t" (for tangency) and then specify a point to the left of the last point but with the same y value.  The larger the distance this point is from the end point the larger the resulting radius of curvature will be  at the top.

2. Select the spline and change to the Control Vertices mode. Move the next to the last CV up so that its Y value is the same as the top end of the spline.

 

ss3.JPG

If the two end CVs have the same y value the slope at the end will be horizontal.

ss4.JPG

lee.minardi
Message 7 of 9
Anonymous
in reply to: leeminardi

Hi Lee.minardi,

 

Thank you a lot for your help.

Like you said, the most challenge is to compute inside spline points 1 thru 7, the rest are just little details and technique.

With your excel file, you've helped me do more than 90% of my task.

 

I use inventor sketch, not Autocad (I guess I'm posting in wrong section?), but that's not big deal, I can take care the rest.

I used your excel file and created sketch, I also tried changing thickness and it works great. Can not ask more than this 🙂

Thank you very much.

 

Best regards,

Minh

 

 

Message 8 of 9
leeminardi
in reply to: Anonymous

One additional recommendation.  It is generally best to use as few fit points (or control vertices) as possible when defining a spline.  The primary reason is that by increasing the number of fit points you increase the likelihood of getting unwanted undulations in the spline.  I assume you want a spline that has a constantly increasing (or decreasing) radius of curvature as you traverse the curve. The fewer the number of fit point that better the likelihood that you will avoid unwanted bumps.

 

You may want to experiment with using half as many points to define both splines. Compare the results with the 9 point spline you are now using.  You will probably find the most deviation between the two curves at the top of the spline where you are letting the slope float if you haven't made an effort to make it horizontal.  You can address this deviation by applying a horizontal constraint to the slope handles in Inventor. 

lee.minardi
Message 9 of 9
Anonymous
in reply to: leeminardi

Thank you for the tips, Lee.

Outside spline is customer request so I need to keep it as is.

Inside contour is uncontrolled, or how say, has big tolerant and controlled by us, so yes, I actually usually reduce number of inside spline points to save time.

 

But with your excel, it is not problem anymore 🙂

 

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Forma Design Contest


AutoCAD Beta