Drawing circles with Bezier curves
Author 
Message 
G. Adam Stanisl #1 / 14

Drawing circles with Bezier curves
If you are interested in knowing how to draw a circle (or an ellipse) using Bezier curves only (that is the only way to do it when, for example, you are creating a Type 1 font), take a look at a new page in which I describe how to do it. The URL is http://www.***.com/ Adam

Thu, 05 Apr 2001 03:00:00 GMT 


G. Adam Stanisl #2 / 14

Drawing circles with Bezier curves
If you are interested in knowing how to draw a circle (or an ellipse) using Bezier curves only (that is the only way to do it when, for example, you are creating a Type 1 font), take a look at a new page in which I describe how to do it. The URL is http://www.whizkidtech.net/bezier/circle/ Adam

Thu, 05 Apr 2001 03:00:00 GMT 


Louis Voslo #3 / 14

Drawing circles with Bezier curves
Quote:
> If you are interested in knowing how to draw a circle (or an ellipse) > using Bezier curves only (that is the only way to do it when, for > example, you are creating a Type 1 font), take a look at a new page in > which I describe how to do it. > The URL is http://www.whizkidtech.net/bezier/circle/
It might be mildy interesting if you solved the general case, that is for an arc other than pi/2. It's not much harder. Or if you included an error analysis and showed that your value of `kappa' did not produce the absolute minimum error (Hint: your error is always on one side).

Thu, 05 Apr 2001 03:00:00 GMT 


G. Adam Stanisl #4 / 14

Drawing circles with Bezier curves
Quote: >> The URL is http://www.whizkidtech.net/bezier/circle/ >It might be mildy interesting if you solved the general case, >that is for an arc other than pi/2. It's not much harder.
Yes, I suppose it would be interesting. It, however, would certainly be more complicating than multiplying the radius by a constant. I am not quite sure of the usefulness of solving the general case, though: The need for emulating an arc with a Bezier curve applies mostly to Type 1 fonts; outside of that, we can use "arc," which is built into postscript but not available in Type 1 fonts. Personally, I have never needed the general case in font design, but I have used the pi/2 arc many times over. If there is a genuine need (other than mere intellectual curiosity) for the general case, I would consider working on it, although not in the immediate future as I am currently working on several different projects. Quote: >Or if you included an error analysis and showed that your value >of `kappa' did not produce the absolute minimum error >(Hint: your error is always on one side).
I am not sure I follow what you mean by my error being always on one side. Please elaborate. Unless you are talking about a roundoff error I have seen in at least one commercial package which clearly uses kappa. It would appear that the program multplies the radius by kappa and keeps the result as a floating point number, then adds it to and subtracts from start/end points, and only then rounds it to an integer. Because of that, the lengths of half of the control line segments differ from the other half by one. The problem is not caused by using kappa but by rounding off the result at the wrong time. If the program rounded off the length to integer before adding/subtracting it, the problem would not be there. If you are referring to some other error, kindly enlighten me by telling me straight what it is you are talking about. Adam P.S. My apologies to everyone for posting the original message twice. Apparently my news server accepted the message on the first attempt but failed to acknowledge it, so my mail software sent it out a second time.

Fri, 06 Apr 2001 03:00:00 GMT 


Joe C. Hech #5 / 14

Drawing circles with Bezier curves
This will prove to be an interesting thead to watch... I have yet to see a any of the clone intrepreters do this correctly. The results are always close, but never produce the same results as Adobe across the board. I ended up paying my brother the "exrocketscientist/professor" quite a bit to reaserch this and develop a solution. Joe  Joe C. Hecht
(850) 6890877 121 Louise Dr. Crestview, FL 32536 http://home1.gte.net/joehecht/index.htm

Fri, 06 Apr 2001 03:00:00 GMT 


William C. Che #6 / 14

Drawing circles with Bezier curves
>> >>>> The URL is http://www.whizkidtech.net/bezier/circle/ >>> >>>It might be mildy interesting if you solved the general case, >>>that is for an arc other than pi/2. It's not much harder. >> >>Yes, I suppose it would be interesting. It, however, would certainly >>be more complicating than multiplying the radius by a constant. I am >>not quite sure of the usefulness of solving the general case, though: >>The need for emulating an arc with a Bezier curve applies mostly to >>Type 1 fonts; outside of that, we can use "arc," which is built into >>PostScript but not available in Type 1 fonts. >> >>Personally, I have never needed the general case in font design, but I >>have used the pi/2 arc many times over. >> >>If there is a genuine need (other than mere intellectual curiosity) >>for the general case, I would consider working on it, although not in >>the immediate future as I am currently working on several different >>projects. > >Actually, there is a genuine need for implementing "arc" with Bezier >curve(s) for drawing PDF (Acrobat). > >PDF is a superset of a subset of PostScript, and it doesn't have >the "arc" operator. So, if you need to draw a circle or arc using >PDF, you must come up with a solution. > >One generalizable solution is available at >http://www.tinaja.com/cubic01.html > >but I don't know where this appeared originally. >Does anyone know? Ps2pdf must also be doing something similar. So ghostscript source code must have the code to do this. 

Fri, 06 Apr 2001 03:00:00 GMT 


Louis Voslo #7 / 14

Drawing circles with Bezier curves
Quote:
> >Or if you included an error analysis and showed that your value > >of `kappa' did not produce the absolute minimum error > >(Hint: your error is always on one side). > I am not sure I follow what you mean by my error being always on one > side. Please elaborate.
The specific approximation you arrive it makes the Bezier curve touch the circle at the center of the arc(45 degree). This makes the Bezier curve always lie on one side of the circle. The sign of the error is constant. If you adjust kappa slightly you can move the point at 45 degree in or out relative to the circle. If you move it so that the Bezier curve crosses the circle, then you can reduce the maximum error. I can't remember too many decimal digits of the optimal value, but it starts .5541... compared to your kappa = 0.5522847498... Of course for most purposes either approximation of the circular arc is good enough... 

Fri, 06 Apr 2001 03:00:00 GMT 


Izumi Ohza #8 / 14

Drawing circles with Bezier curves
Quote:
>>> The URL is http://www.whizkidtech.net/bezier/circle/ >>It might be mildy interesting if you solved the general case, >>that is for an arc other than pi/2. It's not much harder. >Yes, I suppose it would be interesting. It, however, would certainly >be more complicating than multiplying the radius by a constant. I am >not quite sure of the usefulness of solving the general case, though: >The need for emulating an arc with a Bezier curve applies mostly to >Type 1 fonts; outside of that, we can use "arc," which is built into >PostScript but not available in Type 1 fonts. >Personally, I have never needed the general case in font design, but I >have used the pi/2 arc many times over. >If there is a genuine need (other than mere intellectual curiosity) >for the general case, I would consider working on it, although not in >the immediate future as I am currently working on several different >projects.
Actually, there is a genuine need for implementing "arc" with Bezier curve(s) for drawing PDF (Acrobat). PDF is a superset of a subset of PostScript, and it doesn't have the "arc" operator. So, if you need to draw a circle or arc using PDF, you must come up with a solution. One generalizable solution is available at http://www.tinaja.com/cubic01.html but I don't know where this appeared originally. Does anyone know?

Sat, 07 Apr 2001 03:00:00 GMT 


Richard Kinc #9 / 14

Drawing circles with Bezier curves
Quote: > If you are interested in knowing how to draw a circle (or an ellipse) > using Bezier curves only (that is the only way to do it when, for > example, you are creating a Type 1 font), take a look at a new page in > which I describe how to do it.
It might be worth noting that the corresponding value for a 2knot "circle" is 4/3, versus the 4knot case value of 4/3 * (sqrt(2)1). Richard J. Kinch Publisher, TrueTeX brand typesetting software. See http://truetex.com

Sat, 07 Apr 2001 03:00:00 GMT 


Berthold Hor #10 / 14

Drawing circles with Bezier curves
Quote:
> >> The URL is http://www.whizkidtech.net/bezier/circle/ > >It might be mildy interesting if you solved the general case, > >that is for an arc other than pi/2. It's not much harder. > Yes, I suppose it would be interesting. It, however, would certainly > be more complicating than multiplying the radius by a constant. I am > not quite sure of the usefulness of solving the general case, though:
The general case solution (useful or not :) is (for H = half the angle of the arc): kappa = (4/3) (1  cos H) / sin H or kappa = (4/3) \sqrt{ (1  cos H) / (1 + cos H) } or kappa = (4/3) sin H / (1 + cos H) Take your pick  the last one is the better one to use when H is small, (while the first one is the better one to use when H is near pi) Regards, Berthold.

Tue, 10 Apr 2001 03:00:00 GMT 


G. Adam Stanisl #11 / 14

Drawing circles with Bezier curves
Quote: >[...] >>>> The URL is http://www.whizkidtech.net/bezier/circle/ >[...] >One generalizable solution is available at >http://www.tinaja.com/cubic01.html
Thank you for the information. I have now posted a link to that site at the end of my page. I have given you credit for informing me about it, if you'd rather not be mentioned, please let me know. Adam  Whiz Kid Technomagic http://www.whizkidtech.net/

Sat, 14 Apr 2001 03:00:00 GMT 


Izumi Ohza #12 / 14

Drawing circles with Bezier curves
Quote:
>>[...] >>>>> The URL is http://www.whizkidtech.net/bezier/circle/ >>[...] >>One generalizable solution is available at >>http://www.tinaja.com/cubic01.html >Thank you for the information. I have now posted a link to that site >at the end of my page. I have given you credit for informing me about >it, if you'd rather not be mentioned, please let me know.
I don't mind, but you don't have to. Though, I think you should credit Don Lancaster who put together that collection and the original author Jim Fitzsimmons who is mentioned there. Who is Jim Fitzsimmons, BTW? I did a web search, but nothing turns up. Where was that TeXT tutorial published originally? Izumi

Sat, 14 Apr 2001 03:00:00 GMT 


G. Adam Stanisl #13 / 14

Drawing circles with Bezier curves
Quote: >> I am not sure I follow what you mean by my error being always on one >> side. Please elaborate. >The specific approximation you arrive it makes the Bezier curve >touch the circle at the center of the arc(45 degree). This makes the >Bezier curve always lie on one side of the circle. The sign >of the error is constant. If you adjust kappa slightly you can move the >point at 45 degree in or out relative to the circle. If you >move it so that the Bezier curve crosses the circle, then you >can reduce the maximum error. I can't remember too many >decimal digits of the optimal value, but it starts .5541... >compared to your kappa = 0.5522847498...
Hmmm... Interesting observation. But wouldn't the error vary with various implementations of PostScript interpreters? Quote: >Of course for most purposes either approximation of the circular >arc is good enough...
Indeed, in most cases 0.55 alone gives a very good approximation. And I like the idea of my kappa being "as easy as 1234." I do not need to remember (or look up) the value of kappa, I can always calculate it when I need it. :) FWIW, I have used that kappa for years, and it always LOOKED like a perfect circle to me. BTW, where did you find that value? I calculated my own simply because I could not find that information anywhere in literature (this was prewww). Adam  Whiz Kid Technomagic http://www.whizkidtech.net/

Sun, 15 Apr 2001 03:00:00 GMT 


Louis Voslo #14 / 14

Drawing circles with Bezier curves
Quote:
> >point at 45 degree in or out relative to the circle. If you > >move it so that the Bezier curve crosses the circle, then you > >can reduce the maximum error. I can't remember too many > >decimal digits of the optimal value, but it starts .5541... > >compared to your kappa = 0.5522847498... > Hmmm... Interesting observation. But wouldn't the error vary with > various implementations of PostScript interpreters?
No. This is the correct optimum value independent of implementation. If the computer arithmetic is not exact you will get a departure from this which however will be totally insignificant. Quote: > BTW, where did you find that value? I calculated my own simply because > I could not find that information anywhere in literature (this was > prewww).
You start with the value that puts the Bezier curve right on the circle at the middle (see at end), then change the value and look at the maximum departure of the Bezier from the circle. From earlier posting by Berthold K.P. Horn The general case solution (useful or not :) is (for H = half the angle of the arc): kappa = (4/3) (1  cos H) / sin H or kappa = (4/3) \sqrt{ (1  cos H) / (1 + cos H) } or kappa = (4/3) sin H / (1 + cos H) Take your pick  the last one is the better one to use when H is small, (while the first one is the better one to use when H is near pi) 

Sun, 15 Apr 2001 03:00:00 GMT 


