Don't let the polygon routines collapse on a zero line width.

Fixes https://gitlab.com/kicad/code/kicad/issues/9418
This commit is contained in:
Jeff Young 2021-10-20 12:28:01 +01:00
parent 09a2701136
commit b1f17dc927
2 changed files with 6 additions and 4 deletions

View File

@ -31,7 +31,6 @@
#include <pad.h>
#include <pcb_dimension.h>
#include <pcb_track.h>
#include <string_utils.h>
#include <pcb_shape.h>
#include <pcb_text.h>
#include <zone.h>
@ -41,7 +40,6 @@
#include <geometry/geometry_utils.h>
#include <geometry/shape_segment.h>
#include <geometry/shape_circle.h>
#include <geometry/shape_rect.h>
#include <geometry/shape_line_chain.h>

View File

@ -827,12 +827,16 @@ void ZONE_FILLER::buildCopperItemClearances( const ZONE* aZone, PCB_LAYER_ID aLa
{
if( aItem->GetBoundingBox().Intersects( zone_boundingbox ) )
{
int gap = evalRulesForItems( CLEARANCE_CONSTRAINT, aZone, aItem, aLayer );
bool ignoreLineWidths = false;
int gap = evalRulesForItems( CLEARANCE_CONSTRAINT, aZone, aItem, aLayer );
if( aItem->IsOnLayer( Edge_Cuts ) )
{
gap = std::max( gap, evalRulesForItems( EDGE_CLEARANCE_CONSTRAINT,
aZone, aItem, Edge_Cuts ) );
ignoreLineWidths = true;
gap = std::max( gap, bds.GetDRCEpsilon() );
}
if( aItem->IsOnLayer( Margin ) )
@ -841,7 +845,7 @@ void ZONE_FILLER::buildCopperItemClearances( const ZONE* aZone, PCB_LAYER_ID aLa
aZone, aItem, Margin ) );
}
addKnockout( aItem, aLayer, gap, aItem->IsOnLayer( Edge_Cuts ), aHoles );
addKnockout( aItem, aLayer, gap, ignoreLineWidths, aHoles );
}
}
};