LWPOLYLINE bulge to ARC
LWPOLYLINE bulge to ARC
(OP)
Hello people,
I'm struggling with the following; I built a DXF parser/drawer in C++ which works fine, except for the bulges (42) in LWPOLYLINEs. I tried to convert this bulge to an ARC, but I can't figure it out. All the samples online are in Lisp and I don't quite read Lisp...
Can someone please explain in normal mathematical terminology how to convert an LWPOLYLINE bulge into an ARC? I have the coordinates of the starting and ending point and the bulge value and I'd like to turn this into an ARC with a center point, radius, start angle and end angle.
Any help is most appreciated!
Thanks,
- Fahr
I'm struggling with the following; I built a DXF parser/drawer in C++ which works fine, except for the bulges (42) in LWPOLYLINEs. I tried to convert this bulge to an ARC, but I can't figure it out. All the samples online are in Lisp and I don't quite read Lisp...
Can someone please explain in normal mathematical terminology how to convert an LWPOLYLINE bulge into an ARC? I have the coordinates of the starting and ending point and the bulge value and I'd like to turn this into an ARC with a center point, radius, start angle and end angle.
Any help is most appreciated!
Thanks,
- Fahr





RE: LWPOLYLINE bulge to ARC
http://www.afralisp.com/lisp/Bulges1.htm
"Everybody is ignorant, only on different subjects." — Will Rogers
RE: LWPOLYLINE bulge to ARC
RE: LWPOLYLINE bulge to ARC
The story may provide some mathematical geniuses with enough info on deriving the formula, but I am no such genius... I'm really looking for a formula or formulas taking the 3 known parameters and spitting out the needed info for a normal ARC...
- Fahr
RE: LWPOLYLINE bulge to ARC
RE: LWPOLYLINE bulge to ARC
double chord = sqrt(pow(abs(P1.x - P2.x), 2) + pow(abs(P1.y - P2.y), 2));
double s = chord / 2 * bulge;
double radius = (pow(chord / 2, 2) + pow(s, 2)) / (2 * s);
So, I have the radius, yay me. I can't figure out the center point, however...
- Fahr