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

(cherry picked from commit e400d49af6)
This commit is contained in:
Jeff Young 2024-05-26 18:45:40 +01:00
parent 6dd5422137
commit b07de4f6af
1 changed files with 2 additions and 0 deletions

View File

@ -2515,6 +2515,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;