pcbnew: Update multiple zone segments
Where we can get away with lower segment counts (localizing an anchor), we keep the low-def 16 segment count. Intermediate values and values that are visible to the user are set to high definition. Most are simply hints to the inflation correction but where they show, the user show see smooth lines.
This commit is contained in:
parent
c92424898c
commit
25f8b1ce72
|
@ -815,7 +815,7 @@ void CINFO3D_VISU::AddShapeWithClearanceToContainer( const DRAWSEGMENT* aDrawSeg
|
|||
case S_CURVE:
|
||||
case S_POLYGON:
|
||||
{
|
||||
const int segcountforcircle = 16;
|
||||
const int segcountforcircle = ARC_APPROX_SEGMENTS_COUNT_HIGH_DEF;
|
||||
const double correctionFactor = GetCircleCorrectionFactor( segcountforcircle );
|
||||
SHAPE_POLY_SET polyList;
|
||||
|
||||
|
|
|
@ -80,7 +80,7 @@ static void addTextSegmToPoly( int x0, int y0, int xf, int yf, void* aData )
|
|||
void BOARD::ConvertBrdLayerToPolygonalContours( PCB_LAYER_ID aLayer, SHAPE_POLY_SET& aOutlines )
|
||||
{
|
||||
// Number of segments to convert a circle to a polygon
|
||||
const int segcountforcircle = 18;
|
||||
const int segcountforcircle = ARC_APPROX_SEGMENTS_COUNT_HIGH_DEF;
|
||||
double correctionFactor = GetCircletoPolyCorrectionFactor( segcountforcircle );
|
||||
|
||||
// convert tracks and vias:
|
||||
|
|
|
@ -1341,7 +1341,7 @@ void ZONE_CONTAINER::TransformOutlinesShapeWithClearanceToPolygon(
|
|||
// Calculate the polygon with clearance
|
||||
// holes are linked to the main outline, so only one polygon is created.
|
||||
if( clearance )
|
||||
polybuffer.Inflate( clearance, 16 );
|
||||
polybuffer.Inflate( clearance, ARC_APPROX_SEGMENTS_COUNT_HIGH_DEF );
|
||||
|
||||
polybuffer.Fracture( SHAPE_POLY_SET::PM_FAST );
|
||||
aCornerBuffer.Append( polybuffer );
|
||||
|
|
|
@ -1087,7 +1087,7 @@ void DRC::testCopperDrawItem( DRAWSEGMENT* aItem )
|
|||
if( !pad->IsOnLayer( aItem->GetLayer() ) )
|
||||
continue;
|
||||
|
||||
const int segmentCount = 18;
|
||||
const int segmentCount = ARC_APPROX_SEGMENTS_COUNT_HIGH_DEF;
|
||||
double correctionFactor = GetCircletoPolyCorrectionFactor( segmentCount );
|
||||
SHAPE_POLY_SET padOutline;
|
||||
|
||||
|
@ -1153,7 +1153,7 @@ void DRC::testCopperTextItem( BOARD_ITEM* aTextItem )
|
|||
if( !pad->IsOnLayer( aTextItem->GetLayer() ) )
|
||||
continue;
|
||||
|
||||
const int segmentCount = 18;
|
||||
const int segmentCount = ARC_APPROX_SEGMENTS_COUNT_HIGH_DEF;
|
||||
double correctionFactor = GetCircletoPolyCorrectionFactor( segmentCount );
|
||||
SHAPE_POLY_SET padOutline;
|
||||
|
||||
|
|
|
@ -52,7 +52,7 @@ static void gen_arc( std::vector <wxPoint>& aBuffer,
|
|||
const wxPoint& aCenter,
|
||||
int a_ArcAngle )
|
||||
{
|
||||
const int SEGM_COUNT_PER_360DEG = 16;
|
||||
const int SEGM_COUNT_PER_360DEG = ARC_APPROX_SEGMENTS_COUNT_LOW_DEF;
|
||||
auto first_point = aStartPoint - aCenter;
|
||||
int seg_count = ( ( abs( a_ArcAngle ) ) * SEGM_COUNT_PER_360DEG ) / 3600;
|
||||
|
||||
|
|
|
@ -329,7 +329,7 @@ bool D_PAD::GetBestAnchorPosition( VECTOR2I& aPos )
|
|||
{
|
||||
SHAPE_POLY_SET poly;
|
||||
|
||||
if ( !buildCustomPadPolygon( &poly, 16 ) )
|
||||
if ( !buildCustomPadPolygon( &poly, ARC_APPROX_SEGMENTS_COUNT_LOW_DEF ) )
|
||||
return false;
|
||||
|
||||
const int minSteps = 10;
|
||||
|
|
|
@ -814,7 +814,7 @@ bool ZONE_FILLER::fillSingleZone( const ZONE_CONTAINER* aZone, SHAPE_POLY_SET& a
|
|||
{
|
||||
aRawPolys = smoothedPoly;
|
||||
aFinalPolys = smoothedPoly;
|
||||
aFinalPolys.Inflate( -aZone->GetMinThickness() / 2, 16 );
|
||||
aFinalPolys.Inflate( -aZone->GetMinThickness() / 2, ARC_APPROX_SEGMENTS_COUNT_HIGH_DEF );
|
||||
aFinalPolys.Fracture( SHAPE_POLY_SET::PM_FAST );
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue