Trim covered region to bounding hull.

Otherwise a long track crossing a footprint will look
like it covers most of it.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/17299
This commit is contained in:
Jeff Young 2024-05-26 18:45:40 +01:00
parent 8204577fba
commit e400d49af6
1 changed files with 2 additions and 0 deletions

View File

@ -2759,6 +2759,8 @@ double FOOTPRINT::CoverageRatio( const GENERAL_COLLECTOR& aCollector ) const
}
}
coveredRegion.BooleanIntersection( footprintRegion, SHAPE_POLY_SET::PM_FAST );
double footprintRegionArea = polygonArea( footprintRegion );
double uncoveredRegionArea = footprintRegionArea - polygonArea( coveredRegion );
double coveredArea = footprintRegionArea - uncoveredRegionArea;