PNS::Shove Add margin when generating hulls for arc segments

Partially fixes https://gitlab.com/kicad/code/kicad/-/issues/9023

There is still a case where if the shover does not find a solution,
we try clipping the arc and it still collides.
This commit is contained in:
Roberto Fernandez Bautista 2021-11-21 17:12:13 +00:00
parent 15f309c8a8
commit 4e0ad07eb0
1 changed files with 8 additions and 1 deletions

View File

@ -436,7 +436,14 @@ SHOVE::SHOVE_STATUS SHOVE::ShoveObstacleLine( const LINE& aCurLine, const LINE&
for( int i = 0; i < currentLineSegmentCount; i++ ) for( int i = 0; i < currentLineSegmentCount; i++ )
{ {
SEGMENT seg( aCurLine, aCurLine.CSegment( i ) ); SEGMENT seg( aCurLine, aCurLine.CSegment( i ) );
SHAPE_LINE_CHAIN hull = seg.Hull( clearance, obstacleLineWidth, aObstacleLine.Layer() ); int extra = 0;
// Arcs need additional clearance to ensure the hulls are always bigger than the arc
if( aCurLine.CLine().IsArcSegment( i ) )
extra = SHAPE_ARC::DefaultAccuracyForPCB();
SHAPE_LINE_CHAIN hull =
seg.Hull( clearance + extra, obstacleLineWidth, aObstacleLine.Layer() );
hulls.push_back( hull ); hulls.push_back( hull );
} }