|
|
@ -76,20 +76,17 @@ private: |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
static std::shared_ptr<SHAPE_CIRCLE> getDrilledHoleShape( BOARD_ITEM* aItem ) |
|
|
|
static std::shared_ptr<SHAPE_CIRCLE> getHoleShape( BOARD_ITEM* aItem ) |
|
|
|
{ |
|
|
|
if( aItem->HasDrilledHole() ) |
|
|
|
if( aItem->Type() == PCB_VIA_T ) |
|
|
|
{ |
|
|
|
if( aItem->Type() == PCB_VIA_T ) |
|
|
|
{ |
|
|
|
PCB_VIA* via = static_cast<PCB_VIA*>( aItem ); |
|
|
|
return std::make_shared<SHAPE_CIRCLE>( via->GetCenter(), via->GetDrillValue() / 2 ); |
|
|
|
} |
|
|
|
else if( aItem->Type() == PCB_PAD_T ) |
|
|
|
{ |
|
|
|
PAD* pad = static_cast<PAD*>( aItem ); |
|
|
|
return std::make_shared<SHAPE_CIRCLE>( pad->GetPosition(), pad->GetDrillSize().x / 2 ); |
|
|
|
} |
|
|
|
PCB_VIA* via = static_cast<PCB_VIA*>( aItem ); |
|
|
|
return std::make_shared<SHAPE_CIRCLE>( via->GetCenter(), via->GetDrillValue() / 2 ); |
|
|
|
} |
|
|
|
else if( aItem->Type() == PCB_PAD_T ) |
|
|
|
{ |
|
|
|
PAD* pad = static_cast<PAD*>( aItem ); |
|
|
|
return std::make_shared<SHAPE_CIRCLE>( pad->GetPosition(), pad->GetDrillSize().x / 2 ); |
|
|
|
} |
|
|
|
|
|
|
|
return std::make_shared<SHAPE_CIRCLE>( VECTOR2I( 0, 0 ), 0 ); |
|
|
@ -179,7 +176,7 @@ bool DRC_TEST_PROVIDER_HOLE_TO_HOLE::Run() |
|
|
|
// holes (which are generally drilled post laminataion).
|
|
|
|
if( via->GetViaType() != VIATYPE::MICROVIA ) |
|
|
|
{ |
|
|
|
std::shared_ptr<SHAPE_CIRCLE> holeShape = getDrilledHoleShape( via ); |
|
|
|
std::shared_ptr<SHAPE_CIRCLE> holeShape = getHoleShape( via ); |
|
|
|
|
|
|
|
m_holeTree.QueryColliding( via, Edge_Cuts, Edge_Cuts, |
|
|
|
// Filter:
|
|
|
@ -221,10 +218,10 @@ bool DRC_TEST_PROVIDER_HOLE_TO_HOLE::Run() |
|
|
|
if( !reportProgress( ii++, count, progressDelta ) ) |
|
|
|
return false; // DRC cancelled
|
|
|
|
|
|
|
|
// We only care about drilled (ie: round) holes
|
|
|
|
// We only care about drilled (ie: round) pad holes
|
|
|
|
if( pad->HasDrilledHole() ) |
|
|
|
{ |
|
|
|
std::shared_ptr<SHAPE_CIRCLE> holeShape = getDrilledHoleShape( pad ); |
|
|
|
std::shared_ptr<SHAPE_CIRCLE> holeShape = getHoleShape( pad ); |
|
|
|
|
|
|
|
m_holeTree.QueryColliding( pad, Edge_Cuts, Edge_Cuts, |
|
|
|
// Filter:
|
|
|
@ -276,11 +273,11 @@ bool DRC_TEST_PROVIDER_HOLE_TO_HOLE::testHoleAgainstHole( BOARD_ITEM* aItem, SHA |
|
|
|
if( !reportCoLocation && !reportHole2Hole ) |
|
|
|
return false; |
|
|
|
|
|
|
|
std::shared_ptr<SHAPE_CIRCLE> otherHole = getDrilledHoleShape( aOther ); |
|
|
|
std::shared_ptr<SHAPE_CIRCLE> otherHole = getHoleShape( aOther ); |
|
|
|
int epsilon = m_board->GetDesignSettings().GetDRCEpsilon(); |
|
|
|
SEG::ecoord epsilon_sq = SEG::Square( epsilon ); |
|
|
|
|
|
|
|
// Blind-buried or microvias that don't overlap layers aren't an issue.
|
|
|
|
// Blind-buried vias are drilled prior to stackup; they're only an issue if they share layers
|
|
|
|
if( aItem->Type() == PCB_VIA_T && aOther->Type() == PCB_VIA_T ) |
|
|
|
{ |
|
|
|
LSET viaHoleLayers = static_cast<PCB_VIA*>( aItem )->GetLayerSet() & LSET::AllCuMask(); |
|
|
@ -306,7 +303,7 @@ bool DRC_TEST_PROVIDER_HOLE_TO_HOLE::testHoleAgainstHole( BOARD_ITEM* aItem, SHA |
|
|
|
|
|
|
|
auto constraint = m_drcEngine->EvalRules( HOLE_TO_HOLE_CONSTRAINT, aItem, aOther, |
|
|
|
UNDEFINED_LAYER /* holes pierce all layers */ ); |
|
|
|
int minClearance = constraint.GetValue().Min() - epsilon; |
|
|
|
int minClearance = std::max( 0, constraint.GetValue().Min() - epsilon ); |
|
|
|
|
|
|
|
if( constraint.GetSeverity() != RPT_SEVERITY_IGNORE |
|
|
|
&& minClearance >= 0 |
|
|
|