Don't return separate shapes from a custom-shaped pad.

It just confuses the hull generator.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/15553
This commit is contained in:
Jeff Young 2023-09-03 13:23:20 +01:00
parent 61bcf46ffe
commit 43862d767e
1 changed files with 3 additions and 15 deletions

View File

@ -1190,22 +1190,10 @@ std::unique_ptr<PNS::SOLID> PNS_KICAD_IFACE_BASE::syncPad( PAD* aPad )
if( aPad->GetDrillSize().x > 0 ) if( aPad->GetDrillSize().x > 0 )
solid->SetHole( new PNS::HOLE( aPad->GetEffectiveHoleShape()->Clone() ) ); solid->SetHole( new PNS::HOLE( aPad->GetEffectiveHoleShape()->Clone() ) );
// We generate a single SOLID for a pad, so we have to treat it as ALWAYS_FLASHED and then std::shared_ptr<SHAPE_POLY_SET> shape = aPad->GetEffectivePolygon();
// perform layer-specific flashing tests internally.
std::shared_ptr<SHAPE> shape = aPad->GetEffectiveShape( UNDEFINED_LAYER,
FLASHING::ALWAYS_FLASHED );
if( shape->HasIndexableSubshapes() && shape->GetIndexableSubshapeCount() == 1 ) if( shape->OutlineCount() )
{ solid->SetShape( new SHAPE_SIMPLE( shape->Outline( 0 ) ) );
std::vector<const SHAPE*> subshapes;
shape->GetIndexableSubshapes( subshapes );
solid->SetShape( subshapes[0]->Clone() );
}
else
{
solid->SetShape( shape->Clone() );
}
return solid; return solid;
} }