Fix bugs in diffPair hole-to-hole logic and add rule resolution.

Fixes https://gitlab.com/kicad/code/kicad/issues/7697
This commit is contained in:
Jeff Young 2021-02-25 14:21:50 +00:00
parent 2c009906e5
commit caa18c8e16
2 changed files with 11 additions and 2 deletions

View File

@ -535,7 +535,7 @@ bool DIFF_PAIR_PLACER::FindDpPrimitivePair( NODE* aWorld, const VECTOR2I& aP, IT
int DIFF_PAIR_PLACER::viaGap() const int DIFF_PAIR_PLACER::viaGap() const
{ {
return std::max( m_sizes.DiffPairViaGap(), return std::max( m_sizes.DiffPairViaGap(),
m_sizes.GetHoleToHole() + m_viaDrill - m_viaDiameter ); m_sizes.GetHoleToHole() + m_sizes.ViaDrill() - m_sizes.ViaDiameter() );
} }

View File

@ -485,7 +485,16 @@ bool PNS_KICAD_IFACE_BASE::ImportSizes( PNS::SIZES_SETTINGS& aSizes, PNS::ITEM*
aSizes.SetDiffPairGap( diffPairGap ); aSizes.SetDiffPairGap( diffPairGap );
aSizes.SetDiffPairViaGap( diffPairViaGap ); aSizes.SetDiffPairViaGap( diffPairViaGap );
aSizes.SetHoleToHole( bds.m_HoleToHoleMin ); int holeToHoleMin = bds.m_HoleToHoleMin;
PNS::VIA dummyVia;
if( m_ruleResolver->QueryConstraint( PNS::CONSTRAINT_TYPE::CT_HOLE_TO_HOLE, &dummyVia,
&dummyVia, UNDEFINED_LAYER, &constraint ) )
{
holeToHoleMin = constraint.m_Value.Min();
}
aSizes.SetHoleToHole( holeToHoleMin );
aSizes.ClearLayerPairs(); aSizes.ClearLayerPairs();