Use more accurate hull shapes for round solids

Fixes https://gitlab.com/kicad/code/kicad/-/issues/8561
This commit is contained in:
Jon Evans 2021-06-06 09:53:45 -04:00
parent 6b1dfca0ba
commit be61bf29dd
2 changed files with 5 additions and 4 deletions

View File

@ -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:

View File

@ -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 );
}