Browse Source

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
6.0.7
Tomasz Wlostowski 4 years ago
parent
commit
01068e0d41
  1. 2
      libs/kimath/src/geometry/shape_arc.cpp

2
libs/kimath/src/geometry/shape_arc.cpp

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

Loading…
Cancel
Save