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:
Seth Hillbrand 2019-01-03 17:34:59 -08:00
parent c92424898c
commit 25f8b1ce72
7 changed files with 8 additions and 8 deletions

View File

@ -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;

View File

@ -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:

View File

@ -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 );

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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 );
}