a few functions useful in geometry calculations.
More...
Go to the source code of this file.
a few functions useful in geometry calculations.
◆ GetArcToSegmentCount()
int GetArcToSegmentCount |
( |
int |
aRadius, |
|
|
int |
aErrorMax, |
|
|
double |
aArcAngleDegree |
|
) |
| |
- Returns
- the number of segments to approximate a arc by segments with a given max error (this number is >= 1)
- Parameters
-
aRadius | is the radius od the circle or arc |
aErrorMax | is the max error This is the max distance between the middle of a segment and the circle. |
aArcAngleDegree | is the arc angle in degrees |
◆ GetCircletoPolyCorrectionFactor()
double GetCircletoPolyCorrectionFactor |
( |
int |
aSegCountforCircle | ) |
|
- Returns
- the correction factor to approximate a circle by segments
- Parameters
-
aSegCountforCircle | is the number of segments to approximate the circle |
When creating a polygon from a circle, the polygon is inside the circle. Only corners are on the circle. This is incorrect when building clearance areas of circles, that need to build the equivalent polygon outside the circle The correction factor is a scaling factor to apply to the radius to build a polygon outside the circle (only the middle of each segment is on the circle