From b07de4f6aff7269cedc7ba1e4269137c96391816 Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Sun, 26 May 2024 18:45:40 +0100 Subject: [PATCH] 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 e400d49af6d7796bb49200427f9a8512fa04b0c5) --- pcbnew/footprint.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pcbnew/footprint.cpp b/pcbnew/footprint.cpp index c96917bb94..70d92f1041 100644 --- a/pcbnew/footprint.cpp +++ b/pcbnew/footprint.cpp @@ -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;