How to create an approximation of the 2nd arc with line segments?

I have a multilinear contour consisting of segments and arcs of circles that I want to extrude onto prisms.

Since my extrusion functions only support polygons with a straight edge, I need to approximate the arcs using line segments.

Arcs are defined through the start point, center point, and sweep angle (CCW).

The rotation angles I must display range from <10 ° to 179.9 ° with radii from 0.3 to 300 mm.

Currently, I am calculating the number of arc vertices to calculate and adding them to my polygon in a primitive way: I just lay the vertex on every mm of the given arc length. Although this works, it seems very inefficient for arcs with a large radius and a small sweeping angle.

There should be an algorithm that generates good approximations for all kinds of arcs. If there is, I would like to know some keywords to narrow my search on the Internet.

+4
source share
1 answer

If the arc has a sweep angle a, radius r, then the largest distance between the chord with the same endpoints and the arc is r * (1-cos (a / 2). If you divide this arc located along it, then the maximum distance between the arc and the segmented line will be r * (1-cos (a / (2 * (n + 1)))).

So, if you want to keep the greatest distance below E, say, then you could place n new points along the arc, and n is chosen so that n + 1> = a / (2 * acos (1 - E / r))

+4
source

All Articles