Horizon
|
a few functions useful in geometry calculations. More...
Macros | |
#define | MIN_SEGCOUNT_FOR_CIRCLE 8 |
Functions | |
int | GetArcToSegmentCount (int aRadius, int aErrorMax, double aArcAngleDegree) |
int | CircleToEndSegmentDeltaRadius (int aRadius, int aSegCount) |
int | GetCircleToPolyCorrection (int aMaxError) |
a few functions useful in geometry calculations.
int CircleToEndSegmentDeltaRadius | ( | int | aInnerCircleRadius, |
int | aSegCount | ||
) |
aInnerCircleRadius | is the radius of the circle tangent to the middle of segments |
aSegCount | is the seg count to approximate the circle |
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 |
int GetCircleToPolyCorrection | ( | int | aMaxError | ) |
aMaxError | is the same error value used to calculate the number of segments. |
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.