diff --git a/pcbnew/router/pns_utils.cpp b/pcbnew/router/pns_utils.cpp index f155915461..57bf80f7da 100644 --- a/pcbnew/router/pns_utils.cpp +++ b/pcbnew/router/pns_utils.cpp @@ -271,7 +271,7 @@ void HullIntersection( const SHAPE_LINE_CHAIN& hull, const SHAPE_LINE_CHAIN& lin hull.Intersect( line, ips_raw ); - for( const auto& p : ips_raw ) + for( auto& p : ips_raw ) { SHAPE_LINE_CHAIN::INTERSECTION ipp; @@ -289,6 +289,9 @@ void HullIntersection( const SHAPE_LINE_CHAIN& hull, const SHAPE_LINE_CHAIN& lin continue; } + if( p.index_our >= hull.SegmentCount() ) + p.index_our -= hull.SegmentCount(); + if( p.is_corner_our ) { d1[0] = hull.CSegment( p.index_our ); @@ -340,4 +343,4 @@ void HullIntersection( const SHAPE_LINE_CHAIN& hull, const SHAPE_LINE_CHAIN& lin } } -} \ No newline at end of file +}