diff --git a/3d-viewer/3d_draw_board_body.cpp b/3d-viewer/3d_draw_board_body.cpp index d7419d098c..bde6004551 100644 --- a/3d-viewer/3d_draw_board_body.cpp +++ b/3d-viewer/3d_draw_board_body.cpp @@ -351,30 +351,13 @@ void EDA_3D_CANVAS::buildBoard3DView( GLuint aBoardList, GLuint aBodyOnlyList, if( bufferPolys.IsEmpty() ) continue; - std::auto_ptr dumper( new SHAPE_FILE_IO( "poly_dump.txt", true ) ); - // Use Clipper lib to subtract holes to copper areas - dumper->BeginGroup( "clipper-zone" ); - - dumper->Write( &bufferPolys, "pre-simplify" ); bufferPolys.Simplify(); - dumper->Write( &bufferPolys, "post-simplify" ); - currLayerHoles.Simplify(); allLayerHoles.Simplify(); - //dumper->Write(&bufferPolys, "pre-sub"); - //dumper->Write(&allLayerHoles, "holes"); - - // Add through holes (created only once) in current polygon holes list - //bufferPolys.BooleanSubtract( currLayerHoles ); - //bufferPolys.Simplify(); bufferPolys.BooleanSubtract( allLayerHoles ); - - //dumper->Write(&bufferPolys, "post-sub"); - dumper->EndGroup(); - bufferPolys.Fracture(); int thickness = GetPrm3DVisu().GetLayerObjectThicknessBIU( layer ); diff --git a/common/geometry/shape_poly_set.cpp b/common/geometry/shape_poly_set.cpp index e3d6e2cb93..b70f84e1f8 100644 --- a/common/geometry/shape_poly_set.cpp +++ b/common/geometry/shape_poly_set.cpp @@ -257,7 +257,7 @@ void SHAPE_POLY_SET::Inflate( int aFactor, int aCircleSegmentsCount ) PolyTree solution; - c.ArcTolerance = (double)aFactor / M_PI / aCircleSegmentsCount; + c.ArcTolerance = (double)fabs( aFactor ) / M_PI / aCircleSegmentsCount; c.Execute( solution, aFactor ); diff --git a/include/geometry/shape_poly_set.h b/include/geometry/shape_poly_set.h index 7e378eeb70..58f7e46beb 100644 --- a/include/geometry/shape_poly_set.h +++ b/include/geometry/shape_poly_set.h @@ -251,7 +251,7 @@ class SHAPE_POLY_SET : public SHAPE void BooleanSubtract( const SHAPE_POLY_SET& b ); ///> Performs outline inflation/deflation, using round corners. - void Inflate ( int aFactor, int aCircleSegmentsCount = 32 ); + void Inflate( int aFactor, int aCircleSegmentsCount ); ///> Converts a set of polygons with holes to a singe outline with "slits"/"fractures" connecting the outer ring ///> to the inner holes diff --git a/pcbnew/zone_filling_algorithm.cpp b/pcbnew/zone_filling_algorithm.cpp index 1b715cf4af..e56e786eb9 100644 --- a/pcbnew/zone_filling_algorithm.cpp +++ b/pcbnew/zone_filling_algorithm.cpp @@ -111,7 +111,7 @@ bool ZONE_CONTAINER::BuildFilledSolidAreasPolygons( BOARD* aPcb, SHAPE_POLY_SET* { int margin = m_ZoneMinThickness / 2; m_FilledPolysList = ConvertPolyListToPolySet( m_smoothedPoly->m_CornersList ); - m_FilledPolysList.Inflate( -margin ); + m_FilledPolysList.Inflate( -margin, 16 ); m_FilledPolysList.Fracture(); } diff --git a/pcbnew/zones_convert_brd_items_to_polygons_with_Boost.cpp b/pcbnew/zones_convert_brd_items_to_polygons_with_Boost.cpp index d23562cef0..274f66e3be 100644 --- a/pcbnew/zones_convert_brd_items_to_polygons_with_Boost.cpp +++ b/pcbnew/zones_convert_brd_items_to_polygons_with_Boost.cpp @@ -426,7 +426,7 @@ void ZONE_CONTAINER::AddClearanceAreasPolygonsToPolysList_NG( BOARD* aPcb ) SHAPE_POLY_SET solidAreas = ConvertPolyListToPolySet( m_smoothedPoly->m_CornersList ); - solidAreas.Inflate( -outline_half_thickness ); + solidAreas.Inflate( -outline_half_thickness, segsPerCircle ); solidAreas.Simplify(); SHAPE_POLY_SET holes; diff --git a/pcbnew/zones_convert_to_polygons_aux_functions.cpp b/pcbnew/zones_convert_to_polygons_aux_functions.cpp index 8ac4e585c4..e9af2b1a6c 100644 --- a/pcbnew/zones_convert_to_polygons_aux_functions.cpp +++ b/pcbnew/zones_convert_to_polygons_aux_functions.cpp @@ -65,7 +65,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 ) - aCornerBuffer.Inflate( clearance ); + aCornerBuffer.Inflate( clearance, 16 ); aCornerBuffer.Fracture( ); }