Closing Elliptical Arc

Started by JuneTheSecond, April 11, 2009, 12:00:42 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

JuneTheSecond

Hi,

Recently, a question about to draw the close ellipse on the Elliptical Arc was posted.
It was not easy question. I could not answerd.
So, I've studied again in deep, and made one solution.
The 3-equation can be easily solved, when I introduced a dummy
coordinate system.

You can change the elliptical arc by moving the control point and
change the direction and length of the control lever.

On the first page of Visio drawing the result is shown,
and on the second page the description how to solve the
equations are written.

In Octover, 2007 Anders has posted a question about same problem at,
http://www.officefrustration.com/showthread.php?t=748811
I think Anders has solved the problem.
I would like to hear how you solved.


Best Regards,

Junichi Yoda
http://june.minibird.jp/

Jerry

Thanks for resolve this question. JuneTheSecond, thank you very much. You really safe my time. Thank you again.

JuneTheSecond

#2
If VBA is allowed, my shape "Ellipse by 5 Points" is easy way to draw closed ellipse.
http://www.geocities.jp/visualcalculation/english/index.html#passing
Best Regards,

Junichi Yoda
http://june.minibird.jp/

JuneTheSecond

#3
Hi,

The first EllipticalArcTo.vsd is enhanced with VBA so as you can fit closed ellipse to any Elliptical arc.
Best Regards,

Junichi Yoda
http://june.minibird.jp/

Jerry

It's a very good sample for Elliptical Arc

nashwaan

The solution preseneted by Junichi is brilliant. It shows in a step-by-step the mathematical explanation behind solving the problem of getting the center (and the major and the minor axes) of the ellipse that encloses the elliptical arc.

I include here a similar method of finding the center of the ellipse that encloses the elliptical arc without using xy-plane and without using a master. This method -which is based on VBA- will find the center of the ellipse that encloses the elliptical arc by adding one scratch row for intermediate calcualtions and for the final result. The VBA procedure can find center of any elliptical arc (whether it is 1-D or 2-D shape) and can work on any number of arcs of same shape (arcs in same geometry section or across multiple geometry sections).
Also, the coordinates of the result arc center is expressed locally with respect to elliptical arc shape's coordinate (which can be transfered easily to another shape/page coordinate system by using any of LOC(), PAR(), LOCTOLOC(), or LOCTOPAR() function).

For a simple arc shape, there is one geometry section with one MoveTo row and one EllipticalArcTo row. We can use the following function:

iScratchRow = FindCenterOfEllipticalArc(ActiveWindow.Selection(1), visSectionFirstComponent, visRowVertex + 1)

which will add one scratch row and put formulas for intermediate calucations in cells: A, B, C, D. The final result is in cell X, Y of the newly added scratch row:


Note that the 2nd scratch row shown here becuase I asked the procedure to find the major and minor axes of the elliptical arc as well.

I think this is more compact solution than having a supporting xy-plane shape. We can test the X, Y cells contain the correct result by creating a shape and making its location at X, Y cells of the scratch row:
PinX = PinY = GUARD(LOCTOPAR(PNT(Sheet.1!Scratch.X1,Sheet.1!Scratch.Y1),Sheet.1!Width,Width))
where Sheet.1 is the name of the elliptical arc shape.

Some elliptical arc shape before finding their center and the matching ellipse:


The same elliptical arc shapes after findting their center (red circle) and the matching ellipses (gray circle):


The attachment contains the code which creates the formulas in the ShapeSheet of the elliptical arc.

Yousuf.
Give me six hours to chop down a tree and I will spend the first four sharpening the axe — Abraham Lincoln