Don't create 22.5-degree gateways if we're not cardinal or diagonal.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/14984
This commit is contained in:
parent
c183e3f342
commit
d3099ecf75
|
@ -610,8 +610,11 @@ void DP_GATEWAYS::buildDpContinuation( const DP_PRIMITIVE_PAIR& aPair, bool aIsD
|
||||||
if( !aPair.Directional() )
|
if( !aPair.Directional() )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// Add gateways that angle the anchor points by 22.5 degrees for connection to tracks which
|
// If we're at a "normal" angle (cardinal or 45-degree-diagonal), then add gateways that angle
|
||||||
// are at +/- 45 degrees from the existing direction.
|
// the anchor points by 22.5-degrees for connection to tracks which are at +/- 45 degrees from
|
||||||
|
// the existing direction.
|
||||||
|
|
||||||
|
int epsilon = 5; // 0.005um
|
||||||
|
|
||||||
auto addAngledGateways =
|
auto addAngledGateways =
|
||||||
[&]( int length, int priority )
|
[&]( int length, int priority )
|
||||||
|
@ -633,11 +636,16 @@ void DP_GATEWAYS::buildDpContinuation( const DP_PRIMITIVE_PAIR& aPair, bool aIsD
|
||||||
m_gateways.push_back( gwExtendN );
|
m_gateways.push_back( gwExtendN );
|
||||||
};
|
};
|
||||||
|
|
||||||
addAngledGateways( KiROUND( (double) m_gap * 0.38268 ), 20 );
|
VECTOR2I delta = aPair.AnchorP() - aPair.AnchorN();
|
||||||
|
|
||||||
// fixme; sin(22.5) doesn't always work, so we also add some lower priority ones with a bit
|
if( abs( delta.x ) < epsilon || abs( delta.y ) < epsilon || abs( delta.x - delta.y ) < epsilon )
|
||||||
// of wiggle room. See https://gitlab.com/kicad/code/kicad/-/issues/12459.
|
{
|
||||||
addAngledGateways( KiROUND( (double) m_gap * 0.4 ), 5 );
|
addAngledGateways( KiROUND( (double) m_gap * 0.38268 ), 20 );
|
||||||
|
|
||||||
|
// fixme; sin(22.5) doesn't always work, so we also add some lower priority ones with a
|
||||||
|
// bit of wiggle room. See https://gitlab.com/kicad/code/kicad/-/issues/12459.
|
||||||
|
addAngledGateways( KiROUND( (double) m_gap * 0.4 ), 5 );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue