Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Does anyone know the formula (s) used for making a PEllipse?

50 REPLIES 50
SOLVED
Reply
Message 1 of 51
norm77
3045 Views, 50 Replies

Does anyone know the formula (s) used for making a PEllipse?

Hello,

  I write programs for large CNC routers, and I'm trying to make a parametric program that uses an ellipse in it.  I need to know the formula or formulas used to produce the arcs that make up a pellipse so that I can get the radii, and end points of each arc.  Any help would be greatly appreciated, Thanks.

 

-Norm

50 REPLIES 50
Message 2 of 51
hayalexj
in reply to: norm77

In the past I have used the geometry of http://en.wikipedia.org/wiki/Trammel_of_Archimedes in VBA to generate coordinates along eliptical arcs.

 

A

Message 3 of 51
norm77
in reply to: hayalexj


@hayalexj wrote:

In the past I have used the geometry of http://en.wikipedia.org/wiki/Trammel_of_Archimedes in VBA to generate coordinates along eliptical arcs.

 

A



Thanks, I have looked at that already - which is great, but doesn't give enough information.  I have also looked into the "five centered arch" in http://mysite.du.edu/~jcalvert/math/ellipse.htm, which is ok, but not as accurate or usable as the pellipse in AutoCAD.

 

For programming, the current way a pellipse is created is great.  Each quadrant is made up of 4 arcs.  The end point for each arc is in line with the center of the arcs on either side of it, which flow seamlessly into each other.

 

For my purposes, I need to be able to calculate the radius, and start & end point of every arc (referenced from the center of the ellipse).  Thanks.

 

-Norm

Message 4 of 51
hayalexj
in reply to: norm77

I don't know why you would want to create arcs? Surely that's an inaccurate way to do it?

I just generated a series of points along the elliptical arc and fed that directly into the tool path.

What more information do you need in addition to that wikipedia page?
Message 5 of 51
norm77
in reply to: hayalexj


@hayalexj wrote:
I don't know why you would want to create arcs? Surely that's an inaccurate way to do it?

I just generated a series of points along the elliptical arc and fed that directly into the tool path.

What more information do you need in addition to that wikipedia page?

Unfortunately I can't create ellipses on the machines I'm programming.  The accuracy of the Pellipse isn't perfect, but good for my application, and easy to check the logic in Excel and AutoCAD.  I really like the Trammel of Archimedes, but I don't know how to apply it.  The basic parametric programming logic I do can be replicated within excel.


-Norm

Message 6 of 51
hayalexj
in reply to: norm77

What I did would not run in Excel without modification. It used the IntersectsWith function to locate the point at which a circle moving along the x axis hit the y axis and then projected arc coordinates through that.
Message 7 of 51
norm77
in reply to: hayalexj

This is what I've been able to figure out so far...

 

 

PELLIPSE CALCULATE.jpg

 

Based on the picture shown above:

 

AF is major axis

AB is minor axis

 

Line IHD is perpendicular to BF

Line JIC is perpendicular to BD

Line HGE is perpendicular to DF

 

Line GF = First Arc Radius

Line HE = Second Arc Radius

Line IC = Third Arc Radius

Line JB = Fourth Arc Radius

 

Message 8 of 51
hayalexj
in reply to: norm77

I think you would have to work out the angle between JC and JA and so on depending on the dims of your arc... Sounds like a lot of effort for an inaccurate way to do it.

The trammel option just requires the ratio of long to short dimension...
Message 9 of 51
norm77
in reply to: hayalexj

Yes the trammel option gives X and Y coordinates easily (If only it could be that easy Smiley Frustrated), but the arcs between can't be calculated which means they would not line up.  Trammel option doesn't give the radii of the arcs.

 

The key to making this without being able to program ellipses is to have all the arcs have the same start angle as the one that it connects to.

Message 10 of 51
hayalexj
in reply to: norm77

So forget the arcs; they serve no purpose.
Message 11 of 51
norm77
in reply to: hayalexj

Without arcs I can't make ellipses, unless I use hundreds or thousands of small lines from a CADCAM program - which can't be parametric and the reason I'm looking for some formula(s)!

Message 12 of 51
hayalexj
in reply to: norm77

Why wouldn't the formula for hundreds of short lines be parametric?
Message 13 of 51
norm77
in reply to: hayalexj

Parametric programming for me and the machines that I take care of is always written manually.  Who wants to manually write a program with hundreds or thousands of calculations & lines of code for a machine that at the end of it, and expect to have not made any errors in the program, let alone the crazy amount of time required to do it???

Message 14 of 51
hayalexj
in reply to: norm77

Surely whatever code you have to write would allow some kind of loop such that you just tell it to run the calculation say a thousand times?

You said that you needed a formula that could be calculated in Excel and Excel would not require you to work out each tiny line individually! If you must insist on using inaccurate arcs then you could use the coordinates generated by the accurate formula as the start, end and midpoints to plot arcs.

Message 15 of 51
norm77
in reply to: hayalexj


@hayalexj wrote:
Surely whatever code you have to write would allow some kind of loop such that you just tell it to run the calculation say a thousand times?

You said that you needed a formula that could be calculated in Excel and Excel would not require you to work out each tiny line individually! If you must insist on using inaccurate arcs then you could use the coordinates generated by the accurate formula as the start, end and midpoints to plot arcs.

I feel like I'm not being listened to.  I cannot program ellipses - therefor I have to program arcs.  I need formula(s) that can replicate a pellipse from AutoCAD, which requires knowing the start, end, and radius of each and every arc.

 

I've been writing parametric programs for many years for CNC routers, which require formula(s) in order to make them!

 

-Norm

Message 16 of 51
hayalexj
in reply to: norm77

You "cannot program ellipses - therefor" you should program many lines.

 

For the record, it's not the best way to do it, but you can just use the trammel formula to generate the three points for each of the arcs.

Message 17 of 51
johnds
in reply to: norm77

Norm,

 

Can you explain how you use autocad to 'program' the cnc machine? Does the cnc machine understand an acad drawing? I presume if it does, then it only 'understands' certain drawing element types (ie arc, lines, but not ellipses).

 

If what i just said is incorrect, can you explain it a bit more, especially when you say it needs 'formulas'?

 

I think AGX may be able to help you if I could understand your needs a bit better.

 

Thanks

John

studioDIGITALresin.

Message 18 of 51
M_Hensley
in reply to: norm77

This may not be any help to you, but it happens that if you offset an ellipse in AutoCAD it becomes a spline. So if a spline would be of more use than an ellipse just offset it a certain distance, erase the original ellipse then offset it back.

Message 19 of 51
johnds
in reply to: norm77

I doubt it that if the CNC machine cant work with Ellipses, then it wont understand splines. This is a complete guess 😉

Message 20 of 51
norm77
in reply to: hayalexj

I write Gcode programming - my options are only lines and arcs, and the routers do not accept drawings of any kind (no CADCAM on machines).  I have limited number of variables so even if I wanted the daunting task of calculating and writing formulas for hundreds of lines, and even with looping it wouldn't work (program space issues then).

 

When I program any line - I need the X & Y axis location for the start and end points of that line.  When I program arcs - I need the X & Y axis start and end points as well as either the radius or the X & Y axis location of the center of the Arc in relation to the start point.  I'm not 100% sure, but I don't think that using the Trammel formula "on 3 point arcs" (which I didn't think of using it that way) will work because of having to find either the arc's center or the radius.

 

Basically, I need to enter the Major axis, and Minor axis sizes into 2 variables, and be able to calculate the start, end, and radii of a set number of arcs to mimic an ellipse or pellipse.  This is why I said that excel can be used in programming.  Enter 200 in one cell and 350 in another, and then calculate with formulas the arcs that would make up a quadrant (other quadrants can be mirrored).

 

A Pellipse in AutoCAD is great because each arc flows into the next because the ending angle of one arc is the starting angle of the next, and there are only 4 arcs which simplifies the calculations required (when you have the formula).  I understand how the Pellipse is made (see picture posted earlier in this thread), but I don't have the formula(s) to complete it.

 

-Norm

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

Post to forums  

Autodesk Design & Make Report

”Boost