Browse Source

Use more accurate hull shapes for round solids

Fixes https://gitlab.com/kicad/code/kicad/-/issues/8561
6.0.7
Jon Evans 5 years ago
parent
commit
be61bf29dd
  1. 2
      pcbnew/router/pns_solid.cpp
  2. 7
      pcbnew/router/pns_via.cpp

2
pcbnew/router/pns_solid.cpp

@ -59,7 +59,7 @@ static const SHAPE_LINE_CHAIN buildHullForPrimitiveShape( const SHAPE* aShape, i
return OctagonalHull( circle->GetCenter() - VECTOR2I( r, r ),
VECTOR2I( 2 * r, 2 * r ),
cl + 1,
0.52 * ( r + cl ) );
0.585 * ( r + cl ) );
}
case SH_SEGMENT:

7
pcbnew/router/pns_via.cpp

@ -79,9 +79,10 @@ const SHAPE_LINE_CHAIN VIA::Hull( int aClearance, int aWalkaroundThickness, int
if( !ROUTER::GetInstance()->GetInterface()->IsFlashedOnLayer( this, aLayer ) )
width = m_drill;
return OctagonalHull( m_pos -
VECTOR2I( width / 2, width / 2 ), VECTOR2I( width, width ),
cl + 1, ( 2 * cl + width ) * 0.26 );
// Chamfer = width * ( 1 - sqrt(2)/2 ) for equilateral octagon
return OctagonalHull( m_pos - VECTOR2I( width / 2, width / 2 ),
VECTOR2I( width, width ),
cl + 1, ( 2 * cl + width ) * 0.2928 );
}

Loading…
Cancel
Save