From 9ab7cfea0c0f4c3cfb313370697cae25d3a64723 Mon Sep 17 00:00:00 2001 From: jean-pierre charras Date: Sun, 6 Nov 2016 19:51:09 +0100 Subject: [PATCH] * Pcbnew: in fill zones calculations, make polygons strictly simple before fracturing them. --- ...es_convert_brd_items_to_polygons_with_Boost.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) 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 20c9425385..f975c6a553 100644 --- a/pcbnew/zones_convert_brd_items_to_polygons_with_Boost.cpp +++ b/pcbnew/zones_convert_brd_items_to_polygons_with_Boost.cpp @@ -43,7 +43,7 @@ // Polygon calculations can use fast mode or force strickly simple polygons after calculations // Forcing strickly simple polygons is time consuming, and we have not see issues in fast mode -// so we use fast mode +// so we use fast mode when possible (intermediate calculations) // (choice is SHAPE_POLY_SET::PM_STRICTLY_SIMPLE or SHAPE_POLY_SET::PM_FAST) #define POLY_CALC_MODE SHAPE_POLY_SET::PM_FAST @@ -456,7 +456,11 @@ void ZONE_CONTAINER::AddClearanceAreasPolygonsToPolysList_NG( BOARD* aPcb ) if (g_DumpZonesWhenFilling) dumper->Write( &holes, "feature-holes-postsimplify" ); - solidAreas.BooleanSubtract( holes, POLY_CALC_MODE ); + // Generate the filled areas (currently, without thermal shapes, which will + // be created later). + // Use SHAPE_POLY_SET::PM_STRICTLY_SIMPLE to generate strictly simple polygons + // needed by Gerber files and Fracture() + solidAreas.BooleanSubtract( holes, SHAPE_POLY_SET::PM_STRICTLY_SIMPLE ); if (g_DumpZonesWhenFilling) dumper->Write( &solidAreas, "solid-areas-minus-holes" ); @@ -485,8 +489,10 @@ void ZONE_CONTAINER::AddClearanceAreasPolygonsToPolysList_NG( BOARD* aPcb ) if( !thermalHoles.IsEmpty() ) { thermalHoles.Simplify( POLY_CALC_MODE ); - // Remove unconnected stubs - solidAreas.BooleanSubtract( thermalHoles, POLY_CALC_MODE ); + // Remove unconnected stubs. Use SHAPE_POLY_SET::PM_STRICTLY_SIMPLE to + // generate strictly simple polygons + // needed by Gerber files and Fracture() + solidAreas.BooleanSubtract( thermalHoles, SHAPE_POLY_SET::PM_STRICTLY_SIMPLE ); if( g_DumpZonesWhenFilling ) dumper->Write( &thermalHoles, "thermal-holes" );