×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

LWPOLYLINE bulge to ARC

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

RE: LWPOLYLINE bulge to ARC

I always wondered that myself.  I had tried to figure it out myself but was never sucessful.  Thanks borgunit.  (Resistance is futile)

RE: LWPOLYLINE bulge to ARC

(OP)
I already found that site, borgunit, but it describes all the procedures in LISP using many default AutoCAD functions which I can't just implement in C.
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

Fahr - "The bulge is the tangent of 1/4 of the included angle for the arc between the selected vertex and the next vertex in the polyline's vertex list. A negative bulge value indicates that the arc goes clockwise from the selected vertex to the next vertex. A bulge of 0 indicates a straight segment, and a bulge of 1 is a semicircle."  You should be able to implement that in C.

RE: LWPOLYLINE bulge to ARC

(OP)
IFRs - I read it and I understand it. However, I need more than just that. For now I am just working on turning it into the full circle and then further. I have the following;

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

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources