Track polygon clearance: use the new TransformOvalClearanceToPolygon function, to avoid underestimation of clearance areas.
(issue already found for oval pads) Add some comments.
This commit is contained in:
parent
2fd00b1d23
commit
81642dddd1
|
@ -74,6 +74,12 @@ void TransformOvalClearanceToPolygon( SHAPE_POLY_SET& aCornerBuffer,
|
|||
// so, later, we will clamp the polygonal shape with the bounding box
|
||||
// of the segment.
|
||||
int radius = aWidth / 2;
|
||||
|
||||
// Note if we want to compensate the radius reduction of a circle due to
|
||||
// the segment approx, aCorrectionFactor must be calculated like this:
|
||||
// For a circle the min radius is radius * cos( 2PI / s_CircleToSegmentsCount / 2)
|
||||
// aCorrectionFactor is 1 /cos( PI/s_CircleToSegmentsCount )
|
||||
|
||||
radius = radius * aCorrectionFactor; // make segments outside the circles
|
||||
|
||||
// end point is the coordinate relative to aStart
|
||||
|
|
|
@ -510,8 +510,8 @@ void DRAWSEGMENT::TransformShapeWithClearanceToPolygon( SHAPE_POLY_SET& aCornerB
|
|||
break;
|
||||
|
||||
case S_SEGMENT:
|
||||
TransformRoundedEndsSegmentToPolygon( aCornerBuffer, m_Start, m_End,
|
||||
aCircleToSegmentsCount, linewidth );
|
||||
TransformOvalClearanceToPolygon( aCornerBuffer, m_Start, m_End, linewidth,
|
||||
aCircleToSegmentsCount, aCorrectionFactor );
|
||||
break;
|
||||
|
||||
case S_POLYGON:
|
||||
|
@ -604,10 +604,10 @@ void TRACK::TransformShapeWithClearanceToPolygon( SHAPE_POLY_SET& aCornerBuffer,
|
|||
break;
|
||||
|
||||
default:
|
||||
TransformRoundedEndsSegmentToPolygon( aCornerBuffer,
|
||||
m_Start, m_End,
|
||||
TransformOvalClearanceToPolygon( aCornerBuffer, m_Start, m_End,
|
||||
m_Width + ( 2 * aClearanceValue),
|
||||
aCircleToSegmentsCount,
|
||||
m_Width + ( 2 * aClearanceValue) );
|
||||
aCorrectionFactor );
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -282,7 +282,7 @@ void ZONE_FILLER::buildZoneFeatureHoleList( const ZONE_CONTAINER* aZone,
|
|||
/* calculates the coeff to compensate radius reduction of holes clearance
|
||||
* due to the segment approx.
|
||||
* For a circle the min radius is radius * cos( 2PI / s_CircleToSegmentsCount / 2)
|
||||
* s_Correction is 1 /cos( PI/s_CircleToSegmentsCount )
|
||||
* correctionFactor is 1 /cos( PI/s_CircleToSegmentsCount )
|
||||
*/
|
||||
correctionFactor = 1.0 / cos( M_PI / (double) segsPerCircle );
|
||||
|
||||
|
|
Loading…
Reference in New Issue