Browse Source

router: fix regression in simplifyNewLine() causing unnecessary segments to be added to board (forming loops)

(note to self: OPTIMIZER now unlinks the in-place-optimized LINEs)
pcb_db
Tomasz Wlostowski 11 months ago
parent
commit
bf64e74188
  1. 6
      pcbnew/router/pns_line_placer.cpp

6
pcbnew/router/pns_line_placer.cpp

@ -1913,7 +1913,8 @@ void LINE_PLACER::simplifyNewLine( NODE* aNode, LINKED_ITEM* aLatest )
// And now we can proceed with assembling the final line and optimizing it.
LINE l = aNode->AssembleLine( aLatest );
LINE l_orig = aNode->AssembleLine( aLatest );
LINE l( l_orig );
bool optimized = OPTIMIZER::Optimize( &l, OPTIMIZER::MERGE_COLINEAR, aNode );
@ -1923,9 +1924,10 @@ void LINE_PLACER::simplifyNewLine( NODE* aNode, LINKED_ITEM* aLatest )
if( optimized || simplified.PointCount() != l.PointCount() )
{
aNode->Remove( l );
aNode->Remove( l_orig );
l.SetShape( simplified );
aNode->Add( l );
PNS_DBG( Dbg(), AddItem, &l, RED, 100000, wxT("simplified"));
}
}

Loading…
Cancel
Save