Run hole-to-hole checks on Edge_Cuts layer.
Also makes the flashing logic inside PAD::GetEffectiveShape() easier to understand. Fixes https://gitlab.com/kicad/code/kicad/issues/12296
This commit is contained in:
parent
f0956e48f2
commit
e0f6a6e475
|
@ -147,7 +147,7 @@ bool DRC_TEST_PROVIDER_HOLE_TO_HOLE::Run()
|
|||
|
||||
// We only care about drilled (ie: round) holes
|
||||
if( pad->GetDrillSize().x && pad->GetDrillSize().x == pad->GetDrillSize().y )
|
||||
m_holeTree.Insert( item, F_Cu, m_largestHoleToHoleClearance );
|
||||
m_holeTree.Insert( item, Edge_Cuts, m_largestHoleToHoleClearance );
|
||||
}
|
||||
else if( item->Type() == PCB_VIA_T )
|
||||
{
|
||||
|
@ -155,7 +155,7 @@ bool DRC_TEST_PROVIDER_HOLE_TO_HOLE::Run()
|
|||
|
||||
// We only care about mechanically drilled (ie: non-laser) holes
|
||||
if( via->GetViaType() == VIATYPE::THROUGH )
|
||||
m_holeTree.Insert( item, F_Cu, m_largestHoleToHoleClearance );
|
||||
m_holeTree.Insert( item, Edge_Cuts, m_largestHoleToHoleClearance );
|
||||
}
|
||||
|
||||
return true;
|
||||
|
@ -178,7 +178,7 @@ bool DRC_TEST_PROVIDER_HOLE_TO_HOLE::Run()
|
|||
{
|
||||
std::shared_ptr<SHAPE_CIRCLE> holeShape = getDrilledHoleShape( via );
|
||||
|
||||
m_holeTree.QueryColliding( via, F_Cu, F_Cu,
|
||||
m_holeTree.QueryColliding( via, Edge_Cuts, Edge_Cuts,
|
||||
// Filter:
|
||||
[&]( BOARD_ITEM* other ) -> bool
|
||||
{
|
||||
|
@ -223,7 +223,7 @@ bool DRC_TEST_PROVIDER_HOLE_TO_HOLE::Run()
|
|||
{
|
||||
std::shared_ptr<SHAPE_CIRCLE> holeShape = getDrilledHoleShape( pad );
|
||||
|
||||
m_holeTree.QueryColliding( pad, F_Cu, F_Cu,
|
||||
m_holeTree.QueryColliding( pad, Edge_Cuts, Edge_Cuts,
|
||||
// Filter:
|
||||
[&]( BOARD_ITEM* other ) -> bool
|
||||
{
|
||||
|
|
|
@ -330,17 +330,36 @@ const std::shared_ptr<SHAPE_POLY_SET>& PAD::GetEffectivePolygon() const
|
|||
}
|
||||
|
||||
|
||||
std::shared_ptr<SHAPE> PAD::GetEffectiveShape( PCB_LAYER_ID aLayer, FLASHING aFlash ) const
|
||||
std::shared_ptr<SHAPE> PAD::GetEffectiveShape( PCB_LAYER_ID aLayer, FLASHING flashPTHPads ) const
|
||||
{
|
||||
if( ( GetAttribute() == PAD_ATTRIB::PTH && aFlash == FLASHING::NEVER_FLASHED )
|
||||
|| ( aLayer != UNDEFINED_LAYER && !FlashLayer( aLayer ) ) )
|
||||
if( aLayer == Edge_Cuts )
|
||||
{
|
||||
if( GetAttribute() == PAD_ATTRIB::PTH )
|
||||
if( GetAttribute() == PAD_ATTRIB::PTH || GetAttribute() == PAD_ATTRIB::NPTH )
|
||||
return GetEffectiveHoleShape();
|
||||
else
|
||||
return std::make_shared<SHAPE_NULL>();
|
||||
}
|
||||
|
||||
if( GetAttribute() == PAD_ATTRIB::PTH )
|
||||
{
|
||||
bool flash;
|
||||
|
||||
if( flashPTHPads == FLASHING::NEVER_FLASHED )
|
||||
flash = false;
|
||||
else if( flashPTHPads == FLASHING::ALWAYS_FLASHED )
|
||||
flash = true;
|
||||
else
|
||||
flash = FlashLayer( aLayer );
|
||||
|
||||
if( !flash )
|
||||
{
|
||||
if( GetAttribute() == PAD_ATTRIB::PTH )
|
||||
return GetEffectiveHoleShape();
|
||||
else
|
||||
return std::make_shared<SHAPE_NULL>();
|
||||
}
|
||||
}
|
||||
|
||||
if( m_shapesDirty )
|
||||
BuildEffectiveShapes( aLayer );
|
||||
|
||||
|
|
|
@ -432,8 +432,9 @@ public:
|
|||
int aError, ERROR_LOC aErrorLoc ) const;
|
||||
|
||||
// @copydoc BOARD_ITEM::GetEffectiveShape
|
||||
virtual std::shared_ptr<SHAPE> GetEffectiveShape( PCB_LAYER_ID aLayer = UNDEFINED_LAYER,
|
||||
FLASHING aFlash = FLASHING::DEFAULT ) const override;
|
||||
virtual std::shared_ptr<SHAPE>
|
||||
GetEffectiveShape( PCB_LAYER_ID aLayer = UNDEFINED_LAYER,
|
||||
FLASHING flashPTHPads = FLASHING::DEFAULT ) const override;
|
||||
|
||||
const std::shared_ptr<SHAPE_POLY_SET>& GetEffectivePolygon() const;
|
||||
|
||||
|
|
Loading…
Reference in New Issue