setQuadrantSegments method
Sets the number of line segments used to approximate an angle fillet.
- If quadSegs >= 1, joins are round, and quadSegs indicates the number of segments to use to approximate a quarter-circle.
- If quadSegs = 0, joins are bevelled (flat)
- If quadSegs < 0, joins are mitred, and the value of qs
indicates the mitre ration limit as
mitreLimit = |quadSegs|
@param quadSegs the number of segments in a fillet for a quadrant
Implementation
void setQuadrantSegments(int quadSegs) {
quadrantSegments = quadSegs;
/**
* Indicates how to construct fillets.
* If qs >= 1, fillet is round, and qs indicates number of
* segments to use to approximate a quarter-circle.
* If qs = 0, fillet is bevelled flat (i.e. no filleting is performed)
* If qs < 0, fillet is mitred, and absolute value of qs
* indicates maximum length of mitre according to
*
* mitreLimit = |qs|
*/
if (quadrantSegments == 0) joinStyle = JOIN_BEVEL;
if (quadrantSegments < 0) {
joinStyle = JOIN_MITRE;
mitreLimit = quadrantSegments.abs().toDouble();
}
if (quadSegs <= 0) {
quadrantSegments = 1;
}
/**
* If join style was set by the quadSegs value,
* use the default for the actual quadrantSegments value.
*/
if (joinStyle != JOIN_ROUND) {
quadrantSegments = DEFAULT_QUADRANT_SEGMENTS;
}
}