PDA

View Full Version : Ellipse Calculator.


Mike_R
2007-06-28, 04:37 PM
I've been doing a lot of stuff lately that involves strange curves with many points that could be much more realistically, and quite possibly much more easily, if done with ellipse arcs. I have a few obstacles though...

1) The Centroid is unknown.
2) The length of the axes is unknown.
3) The foci are unknown.

All I have to work with is a partial arc... But what I do have is one of the major quadrant points, and an accurate arc to work with. With the quadrant, I can determine the direction of the major axis, and that's where I get lost. I have no idea how to calculate the ellipse to find the center, or the major and minor axes... Using a calculator seems totally impossible... So a LISP routine would be perfect, but I don't know how to write this one.

Anybody have any ideas? Or at the very least a decent formula to calculate points on an ellipse using an assumed center? I might be able to drum something up with that... It'll be ugly, but it would work.

jmcshane
2007-06-28, 06:09 PM
Hi Mike,


I'm not sure are you trying to draw the Ellipse or just get information from the arc's?

For gathering info you could try something like this:


(vl-load-com)
(setq Ell (vlax-ename->vla-object (car (entsel))))
(setq Cen (vlax-safearray->list (vlax-variant-value (vla-get-center Ell)))
MAxisLen (vla-get-MajorRadius Ell)
MIxisLen (vla-get-MinorRadius Ell)

)



John

Tom Beauford
2007-06-28, 06:50 PM
Have you tried listing it or using Properties?

Mike_R
2007-06-28, 07:09 PM
I'm not sure are you trying to draw the Ellipse or just get information from the arc's?

Hehe... Guess I wasn't too clear on that part, was I?

I'm trying to get information from the arcs. What I've actually got is a bunch of short lines imitating arcs which were extrapolated from subtracted/sliced round solids, and then developed into a 2D plate layout to be built in a steel shop. My latest one was actually a pipe that connects into a rectangular duct, with each wall of the duct at a 30 degree angle. And then that connection also has another pipe connecting into both of those on the seam...

I can't think of any good way to note the layouts for the shop to actually be able to build them with any accuracy except for finding the ellipse that would hit at least 3 of the points in the extrapolated arcs...

Oh, and P.S., to all steel engineers here... NEVER do what I just described above. It's much easier to just do a transition, no matter what the size.

Edit: Changed wording for a more accurate description.