Browse Source

Use true arc collision for segment<>arc

Using an approximation here results in different collision
results for segment<>arc than point<>arc, which
can cause odd behavior in the router.


(cherry picked from commit 5b3b0ff836)

Co-authored-by: Jon Evans <jon@craftyjon.com>
8.0
Jon Evans 2 years ago
parent
commit
cecc1a2ff1
  1. 5
      libs/kimath/src/geometry/shape_collisions.cpp

5
libs/kimath/src/geometry/shape_collisions.cpp

@ -651,9 +651,8 @@ static inline bool Collide( const SHAPE_ARC& aA, const SHAPE_SEGMENT& aB, int aC
aA.TypeName(),
aB.TypeName() ) );
const SHAPE_LINE_CHAIN lc( aA );
bool rv = Collide( lc, aB, aClearance + aA.GetWidth() / 2, aActual, aLocation, aMTV );
bool rv = aA.Collide( aB.GetSeg(), aClearance + aA.GetWidth() / 2 + aB.GetWidth() / 2,
aActual, aLocation );
if( rv && aActual )
*aActual = std::max( 0, *aActual - aA.GetWidth() / 2 );

Loading…
Cancel
Save