geometry: fix SHAPE_ARC/SEG collision

The arc2segment collision should at also include the arc endpoint projections on the segment being tested. Not sure it covers all possible cases, though.

Fixes: https://gitlab.com/kicad/code/kicad/-/issues/9023
This commit is contained in:
Tomasz Wlostowski 2021-12-09 00:35:33 +01:00
parent e9847cf2bd
commit 01068e0d41
1 changed files with 2 additions and 0 deletions

View File

@ -242,6 +242,8 @@ bool SHAPE_ARC::Collide( const SEG& aSeg, int aClearance, int* aActual, VECTOR2I
std::vector<VECTOR2I> candidatePts = circle.Intersect( aSeg );
candidatePts.push_back( aSeg.NearestPoint( center ) );
candidatePts.push_back( aSeg.NearestPoint( m_start ) );
candidatePts.push_back( aSeg.NearestPoint( m_end ) );
candidatePts.push_back( aSeg.A );
candidatePts.push_back( aSeg.B );