tag:blogger.com,1999:blog-7689707394670942532.post1374316737159353285..comments2016-11-19T05:05:52.866-08:00Comments on Hans Muller's Flex Blog: More About Approximating Circular Arcs With a Cubic Bezier PathHans Mullerhttp://www.blogger.com/profile/13225910609140131153noreply@blogger.comBlogger9125tag:blogger.com,1999:blog-7689707394670942532.post-54371285855722407802016-10-21T01:29:09.890-07:002016-10-21T01:29:09.890-07:00not giving expected output.not giving expected output.Jayanth a shttp://www.blogger.com/profile/13309098692640768105noreply@blogger.comtag:blogger.com,1999:blog-7689707394670942532.post-26208334245485377442014-06-06T05:36:15.774-07:002014-06-06T05:36:15.774-07:00Hello,
Thank you for this post, it really saved my...Hello,<br />Thank you for this post, it really saved my day (a few, even).<br />However I still have a problem (which can't be reproduced using the embedeed *.as).<br />However, when I'm trying to create a bezier circular segment approximation of PI/2 angle, the code (translated to c#) produces 3 segments, each rotated by 90% to previous one.<br />Those 3 segments cover all quarters, except desired one.<br /><br />I did some thinking on the subject and haven't came to satisfying conclusion. Could you help with defining conditions for exactly 90* arcs?<br />necrosisnixhttp://necrosisnix.livejournal.com/noreply@blogger.comtag:blogger.com,1999:blog-7689707394670942532.post-56370727031430988172014-01-07T12:54:36.042-08:002014-01-07T12:54:36.042-08:00Hans, thank you for this useful blog entry.
I bel...Hans, thank you for this useful blog entry.<br /><br />I believe you can simplify these lines:<br /> const q1:Number = x1*x1 + y1*y1;<br /> const q2:Number = q1 + x1*x4 + y1*y4;<br /> const k2:Number = 4/3 * (Math.sqrt(2 * q1 * q2) - q2) / (x1 * y4 - y1 * x4);<br /><br />to just the line<br /> // Caution: I backported the line below from C, and have not tested or even compiled it:<br /> const k2:Number = 4/3 * (1 - Math.cos(a)) / (Math.sin(a));<br /><br />Incidentally, the only difficult I had in moving to C was that I was careless and left the “4/3” without decimal points, and C performed the integer division and dropped the fraction =:-|mikemortonhttp://www.blogger.com/profile/04893193127657493990noreply@blogger.comtag:blogger.com,1999:blog-7689707394670942532.post-66465746333595705342013-02-17T05:23:33.828-08:002013-02-17T05:23:33.828-08:00Thanks for posting this Hans.
As a note for those...Thanks for posting this Hans.<br /><br />As a note for those following along, after converting PathArcUtils.createSmallArc() to 3D Studio Max "MaxScript", I had to add "* 4/3" to the end of the k2 assignment to generate correct control points (they were 33% too short before the change). Don't know if it's a bug in the posted code or some difference between 3DSM and Actionscript but if anyone else is porting the code and experiencing the same issue, there's the fix (as far as I can tell) ;)Christian Aylwardhttp://www.blogger.com/profile/17339262487943174412noreply@blogger.comtag:blogger.com,1999:blog-7689707394670942532.post-63675554518981109972012-09-14T08:13:52.454-07:002012-09-14T08:13:52.454-07:00[quote]The derivation of the control points for an...[quote]The derivation of the control points for an arc of less than 90 degrees is a little more complicated. If the arc is centered around the X axis, then the length of the tangent line is r * tan(a/2), instead of just r. The magnitude of the vector from each arc endpoint to its control point is k * r * tan(a/2).[/quote]<br /><br />It`s wrong as if a = 90 degrees formula is not reduced to well known case. Actually magnitude is equal to k1 * r, where k1 = 4/3 * (1 - cos(a/2)) / sin(a/2), for a = 90 it reduced to 4/3 * (sqrt(2) - 1).eugene-gffhttp://eugene-gff.livejournal.com/noreply@blogger.comtag:blogger.com,1999:blog-7689707394670942532.post-48856940495153459072012-01-17T07:51:39.158-08:002012-01-17T07:51:39.158-08:00Thanks for the feedback, it's (finally) fixed ...Thanks for the feedback, it's (finally) fixed now.Hans Mullerhttp://www.blogger.com/profile/13225910609140131153noreply@blogger.comtag:blogger.com,1999:blog-7689707394670942532.post-28102615324780140162011-12-05T18:25:42.089-08:002011-12-05T18:25:42.089-08:00You sir, made my day. I've been having some i...You sir, made my day. I've been having some issues with SVG scaling using Inkscape to create pie charts, and was looking for a way to generate bezier curves with code.<br /><br />*tips hat*Samuel B Frieshttp://www.blogger.com/profile/15750580915779261209noreply@blogger.comtag:blogger.com,1999:blog-7689707394670942532.post-4116048206252604862011-11-16T12:24:55.453-08:002011-11-16T12:24:55.453-08:00Very useful, thanks! URL of the second file is:
h...Very useful, thanks! URL of the second file is:<br /><br />https://sites.google.com/site/hansmuller/flex-blog/ArcButton.mxml<br /><br />@Hans<br />maybe you can fix the URLMarcushttp://www.blogger.com/profile/15276546389687032562noreply@blogger.comtag:blogger.com,1999:blog-7689707394670942532.post-20147949679240153572011-10-20T14:17:43.173-07:002011-10-20T14:17:43.173-07:00I was asked to formally grant permission to use th...I was asked to formally grant permission to use the example code. I've added a Creative Commons license to the source code:<br /><br /><br />This work is licensed under the Creative Commons Attribution 3.0<br />Unported License. To view a copy of this license, visit<br />http://creativecommons.org/licenses/by/3.0/ or send a letter to<br />Creative Commons, 444 Castro Street, Suite 900, Mountain View,<br />California, 94041, USA.Hans Mullerhttp://www.blogger.com/profile/13225910609140131153noreply@blogger.com