Author Topic: Closing Elliptical Arc  (Read 16254 times)

0 Members and 1 Guest are viewing this topic.

JuneTheSecond

  • Hero Member
  • *****
  • Posts: 1027
    • Visio Shapes, Stencils and Sample Drawings
Closing Elliptical Arc
« on: April 10, 2009, 07:00:42 PM »
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.


« Last Edit: April 16, 2009, 06:28:28 AM by JuneTheSecond »
Best Regards,

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

Jerry

  • Newbie
  • *
  • Posts: 5
Re: Closing Elliptical Arc
« Reply #1 on: April 11, 2009, 07:20:01 AM »
Thanks for resolve this question. JuneTheSecond, thank you very much. You really safe my time. Thank you again.

JuneTheSecond

  • Hero Member
  • *****
  • Posts: 1027
    • Visio Shapes, Stencils and Sample Drawings
Re: Closing Elliptical Arc
« Reply #2 on: April 13, 2009, 07:35:20 AM »
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
« Last Edit: April 13, 2009, 07:44:18 AM by JuneTheSecond »
Best Regards,

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

JuneTheSecond

  • Hero Member
  • *****
  • Posts: 1027
    • Visio Shapes, Stencils and Sample Drawings
Re: Closing Elliptical Arc
« Reply #3 on: April 14, 2009, 06:22:37 AM »
Hi,

The first EllipticalArcTo.vsd is enhanced with VBA so as you can fit closed ellipse to any Elliptical arc.
« Last Edit: April 14, 2009, 06:24:57 AM by JuneTheSecond »
Best Regards,

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

Jerry

  • Newbie
  • *
  • Posts: 5
Re: Closing Elliptical Arc
« Reply #4 on: April 15, 2009, 05:53:17 PM »
It's a very good sample for Elliptical Arc

nashwaan

  • Full Member
  • ***
  • Posts: 85
Re: Closing Elliptical Arc
« Reply #5 on: May 12, 2012, 02:57:41 PM »
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:

Code
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