diff --git a/pcbnew/class_pad.cpp b/pcbnew/class_pad.cpp index f13e4ac114..e9015b6d8d 100644 --- a/pcbnew/class_pad.cpp +++ b/pcbnew/class_pad.cpp @@ -884,7 +884,7 @@ bool D_PAD::HitTest( const wxPoint& aPosition ) const { // Check for hit in polygon SHAPE_POLY_SET outline; - const int segmentToCircleCount = 32; + const int segmentToCircleCount = ARC_APPROX_SEGMENTS_COUNT_HIGH_DEF; TransformRoundRectToPolygon( outline, wxPoint(0,0), GetSize(), m_Orient, GetRoundRectCornerRadius(), segmentToCircleCount ); diff --git a/pcbnew/class_pad.h b/pcbnew/class_pad.h index ca533ce015..8023a004e5 100644 --- a/pcbnew/class_pad.h +++ b/pcbnew/class_pad.h @@ -30,7 +30,7 @@ #ifndef PAD_H_ #define PAD_H_ - +#include #include #include #include @@ -308,7 +308,7 @@ public: * Note: The corners coordinates are relative to the pad position, orientation 0, */ bool MergePrimitivesAsPolygon( SHAPE_POLY_SET * aMergedPolygon = NULL, - int aCircleToSegmentsCount = 32 ); + int aCircleToSegmentsCount = ARC_APPROX_SEGMENTS_COUNT_HIGH_DEF ); /** * clear the basic shapes list diff --git a/pcbnew/eagle_plugin.cpp b/pcbnew/eagle_plugin.cpp index b676bad50e..a4194ac961 100644 --- a/pcbnew/eagle_plugin.cpp +++ b/pcbnew/eagle_plugin.cpp @@ -1173,7 +1173,7 @@ ZONE_CONTAINER* EAGLE_PLUGIN::loadPolygon( wxXmlNode* aPolyNode ) zone->SetHatch( ZONE_CONTAINER::DIAGONAL_EDGE, zone->GetDefaultHatchPitch(), true ); // clearances, etc. - zone->SetArcSegmentCount( 32 ); // @todo: should be a constructor default? + zone->SetArcSegmentCount( ARC_APPROX_SEGMENTS_COUNT_HIGH_DEF ); // @todo: should be a constructor default? zone->SetMinThickness( std::max( ZONE_THICKNESS_MIN_VALUE_MIL*IU_PER_MILS, p.width.ToPcbUnits() ) ); diff --git a/pcbnew/exporters/export_vrml.cpp b/pcbnew/exporters/export_vrml.cpp index ec8f85aeae..edbc5250df 100644 --- a/pcbnew/exporters/export_vrml.cpp +++ b/pcbnew/exporters/export_vrml.cpp @@ -679,7 +679,7 @@ static void export_vrml_arc( MODEL_VRML& aModel, LAYER_NUM layer, static void export_vrml_polygon( MODEL_VRML& aModel, LAYER_NUM layer, DRAWSEGMENT *aOutline, double aOrientation, wxPoint aPos ) { - const int circleSegmentsCount = 32; + const int circleSegmentsCount = ARC_APPROX_SEGMENTS_COUNT_HIGH_DEF; if( aOutline->IsPolyShapeValid() ) { @@ -1118,7 +1118,7 @@ static void export_vrml_padshape( MODEL_VRML& aModel, VRML_LAYER* aTinLayer, D_P case PAD_SHAPE_ROUNDRECT: { SHAPE_POLY_SET polySet; - int segmentToCircleCount = 32; + int segmentToCircleCount = ARC_APPROX_SEGMENTS_COUNT_HIGH_DEF; const int corner_radius = aPad->GetRoundRectCornerRadius( aPad->GetSize() ); TransformRoundRectToPolygon( polySet, wxPoint( 0, 0 ), aPad->GetSize(), 0.0, corner_radius, segmentToCircleCount ); @@ -1141,7 +1141,7 @@ static void export_vrml_padshape( MODEL_VRML& aModel, VRML_LAYER* aTinLayer, D_P case PAD_SHAPE_CUSTOM: { SHAPE_POLY_SET polySet; - int segmentToCircleCount = 32; + int segmentToCircleCount = ARC_APPROX_SEGMENTS_COUNT_HIGH_DEF; std::vector< wxRealPoint > cornerList; aPad->MergePrimitivesAsPolygon( &polySet, segmentToCircleCount ); diff --git a/pcbnew/pad_custom_shape_functions.cpp b/pcbnew/pad_custom_shape_functions.cpp index c0fa4f0a0b..1c98bd39ee 100644 --- a/pcbnew/pad_custom_shape_functions.cpp +++ b/pcbnew/pad_custom_shape_functions.cpp @@ -233,7 +233,7 @@ bool D_PAD::buildCustomPadPolygon( SHAPE_POLY_SET* aMergedPolygon, polyset.Append( poly[ii].x, poly[ii].y ); } - polyset.Inflate( bshape.m_Thickness/2, 32 ); + polyset.Inflate( bshape.m_Thickness/2, ARC_APPROX_SEGMENTS_COUNT_HIGH_DEF ); aux_polyset.Append( polyset ); } diff --git a/pcbnew/pad_draw_functions.cpp b/pcbnew/pad_draw_functions.cpp index a87dac001a..5a0b5ffd47 100644 --- a/pcbnew/pad_draw_functions.cpp +++ b/pcbnew/pad_draw_functions.cpp @@ -418,9 +418,8 @@ void D_PAD::DrawShape( EDA_RECT* aClipBox, wxDC* aDC, PAD_DRAWINFO& aDrawInfo ) if( aDrawInfo.m_PadClearance ) { - #define SEGCOUNT 32 // number of segments to approximate a circle SHAPE_POLY_SET outline; - TransformShapeWithClearanceToPolygon( outline, aDrawInfo.m_PadClearance, SEGCOUNT, 1.0 ); + TransformShapeWithClearanceToPolygon( outline, aDrawInfo.m_PadClearance, ARC_APPROX_SEGMENTS_COUNT_HIGH_DEF, 1.0 ); // Draw the polygon: Inflate creates only one convex polygon if( outline.OutlineCount() > 0 ) @@ -483,7 +482,7 @@ void D_PAD::DrawShape( EDA_RECT* aClipBox, wxDC* aDC, PAD_DRAWINFO& aDrawInfo ) corner_radius = GetRoundRectCornerRadius() + aDrawInfo.m_PadClearance; TransformRoundRectToPolygon( outline, shape_pos, size, GetOrientation(), - corner_radius, 32 ); + corner_radius, ARC_APPROX_SEGMENTS_COUNT_HIGH_DEF ); if( outline.OutlineCount() > 0 ) { @@ -544,7 +543,7 @@ void D_PAD::DrawShape( EDA_RECT* aClipBox, wxDC* aDC, PAD_DRAWINFO& aDrawInfo ) CustomShapeAsPolygonToBoardPosition( &outline, pad_pos, GetOrientation() ); SHAPE_LINE_CHAIN* poly; - const int segmentToCircleCount = 32; + const int segmentToCircleCount = ARC_APPROX_SEGMENTS_COUNT_HIGH_DEF; if( aDrawInfo.m_Mask_margin.x ) { diff --git a/pcbnew/pcb_painter.cpp b/pcbnew/pcb_painter.cpp index 0ecb339319..63e9d22f5a 100644 --- a/pcbnew/pcb_painter.cpp +++ b/pcbnew/pcb_painter.cpp @@ -855,7 +855,7 @@ void PCB_PAINTER::draw( const D_PAD* aPad, int aLayer ) { SHAPE_POLY_SET outline; outline.Append( aPad->GetCustomShapeAsPolygon() ); - const int segmentToCircleCount = 32; + const int segmentToCircleCount = ARC_APPROX_SEGMENTS_COUNT_HIGH_DEF; outline.Inflate( custom_margin, segmentToCircleCount ); m_gal->DrawPolygon( outline ); } diff --git a/pcbnew/plot_board_layers.cpp b/pcbnew/plot_board_layers.cpp index 6526dd4dae..f33fd73798 100644 --- a/pcbnew/plot_board_layers.cpp +++ b/pcbnew/plot_board_layers.cpp @@ -461,7 +461,7 @@ void PlotStandardLayer( BOARD *aBoard, PLOTTER* aPlotter, D_PAD dummy( *pad ); SHAPE_POLY_SET shape; pad->MergePrimitivesAsPolygon( &shape, 64 ); - shape.Inflate( margin.x, 32 ); + shape.Inflate( margin.x, ARC_APPROX_SEGMENTS_COUNT_HIGH_DEF ); dummy.DeletePrimitivesList(); dummy.AddPrimitive( shape, 0 ); dummy.MergePrimitivesAsPolygon(); @@ -817,7 +817,7 @@ void PlotSolderMaskLayer( BOARD *aBoard, PLOTTER* aPlotter, /* calculates the coeff to compensate radius reduction of holes clearance * due to the segment approx ( 1 /cos( PI/circleToSegmentsCount ) */ - int circleToSegmentsCount = 32; + int circleToSegmentsCount = ARC_APPROX_SEGMENTS_COUNT_HIGH_DEF; double correction = GetCircletoPolyCorrectionFactor( circleToSegmentsCount ); // Plot pads @@ -895,7 +895,7 @@ void PlotSolderMaskLayer( BOARD *aBoard, PLOTTER* aPlotter, // However it is not complex, and fast enough for plot purposes (copy/convert data // is only a very small calculation time for these calculations) ZONE_CONTAINER zone( aBoard ); - zone.SetArcSegmentCount( 32 ); + zone.SetArcSegmentCount( ARC_APPROX_SEGMENTS_COUNT_HIGH_DEF ); zone.SetMinThickness( 0 ); // trace polygons only zone.SetLayer ( layer ); diff --git a/pcbnew/router/pns_kicad_iface.cpp b/pcbnew/router/pns_kicad_iface.cpp index 3a9fc1a84b..f2a55e0d1e 100644 --- a/pcbnew/router/pns_kicad_iface.cpp +++ b/pcbnew/router/pns_kicad_iface.cpp @@ -711,7 +711,7 @@ std::unique_ptr PNS_KICAD_IFACE::syncPad( D_PAD* aPad ) case PAD_SHAPE_ROUNDRECT: { SHAPE_POLY_SET outline; - const int segmentToCircleCount = 32; + const int segmentToCircleCount = ARC_APPROX_SEGMENTS_COUNT_HIGH_DEF; aPad->BuildPadShapePolygon( outline, wxSize( 0, 0 ), segmentToCircleCount, 1.0 );