Browse Source

Handle degenerate polygons in RTrees.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/18600

(cherry picked from commit d5ecb4ab55)
8.0
Jeff Young 12 months ago
parent
commit
fb486ff6b4
  1. 8
      pcbnew/drc/drc_rtree.h

8
pcbnew/drc/drc_rtree.h

@ -353,7 +353,13 @@ public:
[&]( ITEM_WITH_SHAPE* aItem ) -> bool
{
const SHAPE* shape = aItem->shape;
wxASSERT( dynamic_cast<const SHAPE_POLY_SET::TRIANGULATED_POLYGON::TRI*>( shape ) );
// There are certain degenerate cases that result in empty zone fills, which
// will be represented in the rtree with only a root (and no triangles).
// https://gitlab.com/kicad/code/kicad/-/issues/18600
if( shape->Type() != SH_POLY_SET_TRIANGLE )
return true;
auto tri = static_cast<const SHAPE_POLY_SET::TRIANGULATED_POLYGON::TRI*>( shape );
const SHAPE_LINE_CHAIN& outline = poly->Outline( 0 );

Loading…
Cancel
Save