Horizon
|
a few functions useful in geometry calculations. More...
#include <geometry/geometry_utils.h>
Macros | |
#define | MIN_SEGCOUNT_FOR_CIRCLE 6 |
Functions | |
int | GetArcToSegmentCount (int aRadius, int aErrorMax, double aArcAngleDegree) |
double | GetCircletoPolyCorrectionFactor (int aSegCountforCircle) |
a few functions useful in geometry calculations.
int GetArcToSegmentCount | ( | int | aRadius, |
int | aErrorMax, | ||
double | aArcAngleDegree | ||
) |
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 |
double GetCircletoPolyCorrectionFactor | ( | int | aSegCountforCircle | ) |
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