Use more accurate hull shapes for round solids
Fixes https://gitlab.com/kicad/code/kicad/-/issues/8561
This commit is contained in:
parent
6b1dfca0ba
commit
be61bf29dd
|
@ -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:
|
||||
|
|
|
@ -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…
Reference in New Issue