Cleanup tracks and vias not called recursively

Bug #1414328 reported by P
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
KiCad
Fix Released
Undecided
Unassigned

Bug Description

"Cleanup tracks and vias" removes unconnected tracks ("open ends") and merges colinear segments. Merging colinear segments is essential if one wants to use the drag feature ("D" key).

The problem is that the "cleanup" option misses to merge colinear segments if there is also an open end that was removed. In this case, it needs to be called (at least) twice until the desired result is achieved.

Example:

Suppose we have the following tracks: (two colinear segments with a "loose end" attached where they join)
(not sure if the ASCII drawing will look great, but the idea should be visible):

         |
*--------*--------*

The first call of "cleanup" leads to this:

*--------*--------*

Onle the second call of "cleanup" merges the tracks

*-----------------*

In more complicated situations one needs to call cleanup *many* times.

Suggested fix:

The "cleanup algorithm" should be called recursively until no cleanup is left to be done on a specific track.

Suggested improvement of the drag option:

When invoking the "drag" option, automatically merge collinear segments instead of reporting that no dragging is possible because there are colinear segments.

BTW, I am using 2015-01-23 BZR 5386

P (pggl)
description: updated
Revision history for this message
Tomasz Wlostowski (twlostow) wrote :

Dear P,

Did you try out the push & shove dragging feature? If not, just switch to OpenGL mode, enter track placing mode and press G or Ctrl+Click on the track to drag.

Cheers,
Tom

Revision history for this message
P (pggl) wrote :

Yes, it works with the P&S feature, thanks for the hint.

I reported this issue because I assumed the "old" mode would be kept. If not, then this is a non-issue.

tags: added: legacy-canvas pcbnew
Revision history for this message
Chris Gibson (chris-w-gibson) wrote :

in TRACKS_CLEANER::CleanupBoard is the line "modified |= (aMergeSegments && clean_segments());"

If this is changed to

while( aMergeSegments && clean_segments() )
    {
        modfied |= true;
    }

It solves the problem in legacy mode by calling the function clean_segments() repeatedly until no more changes are made.

Revision history for this message
Wayne Stambaugh (stambaughw) wrote :

This patch seems reasonable to me. Is there any reason we wouldn't want the segment clean up to repeat until it's completely cleaned up? This would also give us the same behavior as the GAL canvas mode.

Changed in kicad:
status: New → Fix Committed
Jon Neal (reportingsjr)
Changed in kicad:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.