PNS: Assume the current line is a base before optimizing

We use the cost of the current line before trying to improve the pad
breakout cost when optimizing the smart pads

Fixes #3759 | https://gitlab.com/kicad/code/kicad/issues/3759
This commit is contained in:
Seth Hillbrand 2020-01-12 11:07:32 -08:00
parent 3346f812a9
commit 52bfdb9703
1 changed files with 5 additions and 4 deletions

View File

@ -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;
// 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;
SHAPE_LINE_CHAIN l_best;
bool found = false;
int p_best = -1;
SHAPE_LINE_CHAIN l_best;
for( RtVariant& vp : variants )
{