### Author Topic: interesting elliptical arch problem  (Read 1470 times)

0 Members and 1 Guest are viewing this topic.

#### vojo

• Hero Member
• Posts: 1528
##### interesting elliptical arch problem
« on: November 18, 2018, 01:55:19 AM »
will try to be brief

I came across and interesting problem with elliptical arcs

Basically the width of the arc varies by angles associated with the drawing
For example
- if I draw elliptical arch from 270 deg thru 360 deg, I get one width
- if for same shape, I draw an elliptical arc from 270 deg to 380 deg, the width of the arc shrinks
(I need to do this so I can create a curved manifold)

I would have thought arc would be constant and just paint the region defined by the angles

To get constant curvature, I do (start angle + end angle)/2

#### wapperdude

• Global Moderator
• Hero Member
• Posts: 3833
• Ideas Visio-lized into solutions
##### Re: interesting elliptical arch problem
« Reply #1 on: November 18, 2018, 09:27:59 AM »
Hey!

Idea occurred to me...draw a full eclipse yo the size you want, then draw 2 lines to define region you want, and fragment.
Just a thought.  You can adjust the ellipse to be "exactly" what you need before fragmenting.

HTH,
Wapperdude
Visio 2019 Pro

#### vojo

• Hero Member
• Posts: 1528
##### Re: interesting elliptical arch problem
« Reply #2 on: November 18, 2018, 02:02:05 PM »
thx....sure...for static slices of pie

but trying to make this parametic under the idea that the shape of the ellipse is constant.

will look pathalong

#### vojo

• Hero Member
• Posts: 1528
##### Re: interesting elliptical arch problem
« Reply #3 on: November 18, 2018, 04:44:18 PM »
well...pointalongpath, gets all confused.

Basically, define 3 points with pointalongpath approace

connections 1 = beginning of the bounded arc using ref point, nearnest, pointalongpath
bounding means setting the arch starting point at 180 deg (left side first visible)
always works fine

connections 2 = midpoint of arch (ref, near, pointalongpath)
always works fine

connections 3 = ending of the bound arc using ref point, nearest, pointalongpath
bounding means setting the arc end point at 360 deg (right side last visible)
goes totally nuts
I could be me, but check the equations many times!!!

example
left shape
- elliptical arc from 160 deg to 240 deg in geometry1
- bounded elliptical arc from 180 deg to 240 deg  (left shape see image below)
- first, mid work fine
- ends aligns somewhere around 420 deg (60 deg) and appears to vary based on refresh
right shape
- elliptica arc from 330 deg to 380 deg in geometry1
- bounded elliptical arch from 330 deg to 360 deg (right shape see image below
- first, mid, end work fine

things tried
- tried ,"0mm, 2"            // 2 is the curve segment
- when end point updated with ,0mm, 2....works fine
- when I update begin or mid...end goes nuts
- tried ",,2"                   // 2 is the curve segment
- again fine
- but goes nuts with start and mid updated

Questions
- other than specify offset as positive or negative, is there any other way to influence pointalongpath
(if for example, assume I pick the center of inertia by chance, which point would pointalongpath? how to control?
-if reference point happens sit right on top of the pointalongpath would pick, does it go nuts?  /0 kind of thing

#### vojo

• Hero Member
• Posts: 1528
##### Re: interesting elliptical arch problem
« Reply #4 on: November 18, 2018, 05:13:06 PM »
some background on why I am going to all this trouble

- Visio 3D is sloppy
- Can do depth, sure....but 2 shapes with depth that meet, it gets confused and makes image look messed up at boundary
(depths don't meet/overlap like the shapes)
- In cases of polygons, where you may want to color different panels vs create some sort of theme, cant do that
- connections and controls don't translate well to visio 3D...so makes it real hard to modify shape in iso mode
(sure, could translate back to 2D and adjust shape...but with no visual feedback, its "shooting in the dark"
- Bezels only work if smaller than shape...so cone, sure...but funnel, forget it

BTW, instead of all BS of 3D, visio could have done something simple like this
- GeometryJ,xK <formula> ==> <formula> * ratio       // isometric is ratio = SQRT(3)/2
- GeometryJ.yK <formula> ==> <formula> + offset     // isometric is offset = +GeometryJ.xK*tan(30 deg)
- do this for all rows in shape                                       // proven works for complex 2D shapes...at least thru stars
(could even use another geometry section as a "transform" section...toggle what to show)
(could translate connections easily - pick the geometry section to use)
etc.

Anyway...probably take different approach to this problem (stacked pies)

#### wapperdude

• Global Moderator
• Hero Member
• Posts: 3833
• Ideas Visio-lized into solutions
##### Re: interesting elliptical arch problem
« Reply #5 on: November 18, 2018, 05:59:57 PM »
Since I'm still V2007, can't directly contribute...

Visio 2019 Pro

#### vojo

• Hero Member
• Posts: 1528
##### Re: interesting elliptical arch problem
« Reply #6 on: November 20, 2018, 01:56:28 PM »
Update
- Arcto seems to have same problem
- working thru a "slice" approach

I am beginning to think this needs a clear case of "use a thermonuclear bomb to crack a peanut"
- 1 degree increments
- 360 geometries
- show if between start angle and stop angle inclusive.
- I got to consider if its worth the effort vs just drawing it by hand at the time needed
(remember, the whole point is to have a shape that can "tuned" with a props fields vs always building from scratch!!!)

IMHO, does call into question how formal/disciplined curves are in Visio since the
arc from 30 deg to 60 deg is not the same arc from 30 deg to 120 deg.

#### vojo

• Hero Member
• Posts: 1528
##### Re: interesting elliptical arch problem
« Reply #7 on: November 26, 2018, 10:47:45 AM »
Update

- so I ended up having to spoof this since curve shape changes depending on start angle and end angle
- Basically broke up the angle range into 4 sections and draw "mini arcs"  4 mini arcs = desired arc
- this spoofing seems to fix the issue

- interestingly, there is some sort of hidden relationship I am working around the curve defined in one shape
and the curve defined in another.   Same values in D cell yield slightly difference curvature even though
X,Y, A, B are all the same values and width and height the same

#### wapperdude

• Global Moderator
• Hero Member
• Posts: 3833
• Ideas Visio-lized into solutions
##### Re: interesting elliptical arch problem
« Reply #8 on: December 01, 2018, 11:50:29 AM »
How that I a new version of Visio, thought I'd re-visit this post.

The focus of this reply is using the EllipticalArcTo  (EAT) geometry type plus pointsalongpath  (PAP).

The PAP fcn is useable.  But there are two major caveats.  First, in the Geometry section, the EAT line is preceded by an entry that specifies the initial arc point.  This point must be identical to the starting point of the arc being mimiced.  Any deviation will create a non-identical arc segment.  Second, the "C" & "D" cells must match values of the arc being mimiced.  These are rather big limitations.

So, the PAP can then be used to specify any two points to provide a truncated arc.  It takes just 2 points.  A mid-point that goes into cells "A" & "B", and an end point that goes into the "X" & "Y" cells of the EAT.  These can be applied to a Geometry2 section.  The values may be formula related to Geometry1, or can be literal values based upon Geometry1.  Using formula based values, Geometry1 can be hidden.  Using literal values, Geometry1 can be deleted.

Not sure this accomplishes what you desired.

HTH
Wapperdude
Visio 2019 Pro

#### vojo

• Hero Member
• Posts: 1528
##### Re: interesting elliptical arch problem
« Reply #9 on: December 01, 2018, 02:39:48 PM »
Thanks

1st requirement turned out to be more complicated.  Consider an arc starting at 120 deg and ending at 380 deg.  So I could use PTP for the 180 deg point (sort of below the 120 deg point)...but would not work on 360 point for some reason.
(referencing the EAC X Y point since its the trailing point of the arc)
This may be what you are referencing in your post (still start at 120 deg but specifify the 360 deg point).  for some reason, it "blew up" and drew a giant arc.  FWIW, it worked fine for the mid point (A, B cells...here 240 deg point).

What I ultimately did was to create connection points at 180 deg, new midpoint, 360 deg end point with 2 caveats
- if start point was <180 deg, then 180 deg used else true start point used
- if end point was >360 deg, then 360 deg used else true end point used
- new midpoint would be calculated appropriately from these resulting angles
(these were calculated outside a geometry section....user.DX*cos(user.startangle), user.DY*sin(user.startangle) kind of thing)

these special connection points were used by the manifold.

Now the manifold curve was slightly off (a very small bulge ...<1mm skew)
so set the top in front of manifold so it overlapped the top of the manifold
manifold top points = loctoloc(pnt(<top pie x>, <top pie y>),top pie width,width)
so set the manifold bottom in front of bottom pie and stretched it
manifold bottom points = loctoloc(pnt(<lower pie x>,<lower pie y-1mm>), lower pie width, width)

That said...thanks for following up!!!

BTW, the whole reason I did this (and for other shapes) is that visio 3D is not complete and focused on simple static drawings
(June's work is more thorough and well thought out approach to 3D).
- cant flip the shape (because of how down - Euler angles - have to rotate base shape to do a flip)
- bezeling is from max shape to 0 (cant "bloom" a bezel only "cone" a bezel)
- bezeling is same color of shape and light source to restrictive
- though not used here, control points and connection points are not translated
- etc
so only use visio 3D only for the most complex shapes (10 geometry rows or more...otherwise translate the manually)
(frankly, visio would have been better off doing the following)
- insert another geometry section in each shape (child in a group or single shape)
- geometry2.x<n> = geometry1.x<n> * transform.....geometry2.y<n> = geometry1.y<n> * transform
for example, if ISO then
Geometry2.x<n> = geometry1.x<n>*sqrt(3)
geometry 1.y<n> = geometry1.y<n>+geometry2.x<n>*sin(30 deg)
- flag to show hide geometry 1 and geometry 2

#### wapperdude

• Global Moderator
• Hero Member
• Posts: 3833
• Ideas Visio-lized into solutions
##### Re: interesting elliptical arch problem
« Reply #10 on: December 01, 2018, 03:05:56 PM »
Haven't looked at 3D stuff, other than reversing text.

Yes.  Very easy to blow up the arc!

Visio 2019 Pro

#### vojo

• Hero Member
• Posts: 1528
##### Re: interesting elliptical arch problem
« Reply #11 on: December 01, 2018, 03:32:17 PM »
BTW...one other thing I did

I broke up the arc drawing into 4 arclet drawings
120 deg to 380 deg = 4 arc drawings...each of which spanned 260 deg/4

#### wapperdude

• Global Moderator
• Hero Member
• Posts: 3833
• Ideas Visio-lized into solutions
##### Re: interesting elliptical arch problem
« Reply #12 on: December 01, 2018, 04:38:35 PM »
This might be of interest.  This development lets you move the beginning and end points anywhere along the arc via control points.  Plus, it also uses a control point to set the shape (width/height) ratio.

There are two geometry sections.  One is the full, defining arc.  Its begin / end points are set and can be controlled by shape width/height cells.  The 3rd control changes its aspect ratio.  Geometry1 can be shown/hidden via Action menu.  If you hide it, then you see only Geometry2, the segment of geometry1.  First control point moves the beginning of the segment, and 2nd control moves end of segment.  Both of these use pointsalongpath fcn.  The controls alter, the "pct" value in the function.  Geoimetry2  "C" and "D" cells are slaved to Geometry1.

That's about all for now.  Haven't tried to expand the approach to full ellipse.  A fourth control could be introduced to set Geometry1 "C" cell.
Visio 2019 Pro