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:
parent
3346f812a9
commit
52bfdb9703
|
@ -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
|
// 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
|
// 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.
|
// 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.
|
||||||
long long int max_length = 0;
|
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;
|
SHAPE_LINE_CHAIN l_best;
|
||||||
bool found = false;
|
|
||||||
int p_best = -1;
|
|
||||||
|
|
||||||
for( RtVariant& vp : variants )
|
for( RtVariant& vp : variants )
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue