diff --git a/pcbnew/router/pns_optimizer.cpp b/pcbnew/router/pns_optimizer.cpp index f6881a510c..58e9da9bf7 100644 --- a/pcbnew/router/pns_optimizer.cpp +++ b/pcbnew/router/pns_optimizer.cpp @@ -665,14 +665,14 @@ OPTIMIZER::BREAKOUT_LIST OPTIMIZER::circleBreakouts( int aWidth, } -OPTIMIZER::BREAKOUT_LIST OPTIMIZER::convexBreakouts( int aWidth, - const SHAPE* aShape, bool aPermitDiagonal ) const +OPTIMIZER::BREAKOUT_LIST OPTIMIZER::customBreakouts( int aWidth, + const ITEM* aItem, bool aPermitDiagonal ) const { BREAKOUT_LIST breakouts; - const SHAPE_SIMPLE* convex = static_cast( aShape ); + const SHAPE_SIMPLE* convex = static_cast( aItem->Shape() ); BOX2I bbox = convex->BBox( 0 ); - VECTOR2I p0 = bbox.Centre(); + VECTOR2I p0 = static_cast( aItem )->Pos(); // must be large enough to guarantee intersecting the convex polygon int length = bbox.GetSize().EuclideanNorm() / 2 + 5; @@ -792,11 +792,13 @@ OPTIMIZER::BREAKOUT_LIST OPTIMIZER::computeBreakouts( int aWidth, return circleBreakouts( aWidth, shape, aPermitDiagonal ); case SH_SIMPLE: - return convexBreakouts( aWidth, shape, aPermitDiagonal ); + return customBreakouts( aWidth, aItem, aPermitDiagonal ); default: break; } + + break; } default: diff --git a/pcbnew/router/pns_optimizer.h b/pcbnew/router/pns_optimizer.h index b12e7a4020..c216b4047d 100644 --- a/pcbnew/router/pns_optimizer.h +++ b/pcbnew/router/pns_optimizer.h @@ -161,7 +161,7 @@ private: BREAKOUT_LIST circleBreakouts( int aWidth, const SHAPE* aShape, bool aPermitDiagonal ) const; BREAKOUT_LIST rectBreakouts( int aWidth, const SHAPE* aShape, bool aPermitDiagonal ) const; BREAKOUT_LIST ovalBreakouts( int aWidth, const SHAPE* aShape, bool aPermitDiagonal ) const; - BREAKOUT_LIST convexBreakouts( int aWidth, const SHAPE* aShape, bool aPermitDiagonal ) const; + BREAKOUT_LIST customBreakouts( int aWidth, const ITEM* aItem, bool aPermitDiagonal ) const; BREAKOUT_LIST computeBreakouts( int aWidth, const ITEM* aItem, bool aPermitDiagonal ) const; int smartPadsSingle( LINE* aLine, ITEM* aPad, bool aEnd, int aEndVertex );