Browse Source

Hatching knockout fixes.

revert-0c36e162
Jeff Young 10 months ago
parent
commit
907f21e739
  1. 16
      pcbnew/board_commit.cpp
  2. 30
      pcbnew/pcb_shape.cpp

16
pcbnew/board_commit.cpp

@ -142,16 +142,16 @@ void BOARD_COMMIT::propagateDamage( BOARD_ITEM* aItem, std::vector<ZONE*>* aStal
BOX2I bbox = aItem->GetBoundingBox();
LSET layers = aItem->GetLayerSet();
if( layers.test( Edge_Cuts ) || layers.test( Margin ) )
layers = LSET::PhysicalLayersMask();
else
layers &= LSET::AllCuMask();
if( layers.empty() )
return;
if( aStaleZones )
{
if( layers.test( Edge_Cuts ) || layers.test( Margin ) )
layers = LSET::PhysicalLayersMask();
else
layers &= LSET::AllCuMask();
if( layers.empty() )
return;
for( ZONE* zone : board->Zones() )
{
if( zone->GetIsRuleArea() )

30
pcbnew/pcb_shape.cpp

@ -304,6 +304,9 @@ void PCB_SHAPE::updateHatching() const
{
EDA_SHAPE::updateHatching();
static std::initializer_list<KICAD_T> knockoutTypes = { PCB_TEXT_T, PCB_TEXTBOX_T,
PCB_SHAPE_T };
if( !m_hatching.IsEmpty() )
{
PCB_LAYER_ID layer = GetLayer();
@ -312,12 +315,33 @@ void PCB_SHAPE::updateHatching() const
for( BOARD_ITEM* item : GetBoard()->Drawings() )
{
if( ( item->Type() == PCB_TEXT_T || item->Type() == PCB_TEXTBOX_T )
&& item->GetLayer() == layer
&& item->GetBoundingBox().Intersects( bbox ) )
if( item == this )
continue;
if( item->IsType( knockoutTypes )
&& item->GetLayer() == layer
&& item->GetBoundingBox().Intersects( bbox ) )
{
item->TransformShapeToPolygon( holes, layer, 0, ARC_LOW_DEF, ERROR_OUTSIDE, true );
}
if( item->Type() == PCB_FOOTPRINT_T )
{
static_cast<FOOTPRINT*>( item )->RunOnDescendants(
[&]( BOARD_ITEM* descendant )
{
if( descendant == this )
return;
if( descendant->IsType( knockoutTypes )
&& descendant->GetLayer() == layer
&& descendant->GetBoundingBox().Intersects( bbox ) )
{
descendant->TransformShapeToPolygon( holes, layer, 0, ARC_LOW_DEF,
ERROR_OUTSIDE, true );
}
} );
}
}
m_hatching.BooleanSubtract( holes );

Loading…
Cancel
Save