From 7e1aef22003ab9ffc9831cb320b4ca458587542a Mon Sep 17 00:00:00 2001 From: Marco Mattila Date: Fri, 16 Aug 2013 14:51:35 +0300 Subject: [PATCH] Pcbnew: fix filleting of zones with parallel adjacent edges --- polygon/PolyLine.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/polygon/PolyLine.cpp b/polygon/PolyLine.cpp index 13c5d08cf9..ee819f8b11 100644 --- a/polygon/PolyLine.cpp +++ b/polygon/PolyLine.cpp @@ -448,6 +448,10 @@ CPolyLine* CPolyLine::Fillet( unsigned int aRadius, unsigned int aSegments ) double radius = aRadius; double denom = sqrt( 2.0 / ( 1 + cosine ) - 1 ); + // Do nothing in case of parallel edges + if( isinf( denom ) ) + continue; + // Limit rounding distance to one half of an edge if( 0.5 * lena * denom < radius ) radius = 0.5 * lena * denom;