diff --git a/pcbnew/router/pns_optimizer.cpp b/pcbnew/router/pns_optimizer.cpp index 896c2f3810..93fc3caf0f 100644 --- a/pcbnew/router/pns_optimizer.cpp +++ b/pcbnew/router/pns_optimizer.cpp @@ -903,11 +903,12 @@ int OPTIMIZER::smartPadsSingle( LINE* aLine, ITEM* aPad, bool aEnd, int aEndVert // but given two, equally valid costs, we want to pick the longer pad exit. The logic // here is that if the pad is oblong, the track should not exit the shorter side and parallel // the pad but should follow the pad's preferential direction before exiting. - int min_cost = INT_MAX; - long long int max_length = 0; + // The baseline guess is to start with the existing line the user has drawn. + int min_cost = COST_ESTIMATOR::CornerCost( *aLine ); + long long int max_length = 0; + bool found = false; + int p_best = -1; SHAPE_LINE_CHAIN l_best; - bool found = false; - int p_best = -1; for( RtVariant& vp : variants ) {