pcb

Rat line calculations miss some lines

Bug #699248 reported by thepurlieu
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
pcb
Fix Released
Medium
Andrew Poelstra

Bug Description

This bug has popped up quite frequently during the past years, but I've never reported it.

Many times I notice the rat line optimizer sometimes "misses" the last line in a chain of lines, and draws the rat line to the next line (see attached file, where one of the rat lines isn't drawn to the last line in the sequence.

After digging a bit into the code, it looks like the last line in the chain doesn't pass the:

TEST_FLAG (DRCFLAG, line)

test in rats.c:492, and thus it is never added to the subnet. I'm assuming this error is actually traced back to when the line is first drawn (?). Regardless, I don't have the experience with the PCB code to trace this problem any further...hopefully someone smarter than me can figure out why some lines are doing this. I can't find a reproducable method of drawing a line that shows this bug...but drawing a line with the "45 degree forcing" on (and clicking on a point that actually makes two lines) seems to make the bug show up more often then not.

Cheers--

Tags: core sf-bugs
Revision history for this message
thepurlieu (thepurlieu-users) wrote :
Revision history for this message
thepurlieu (thepurlieu-users) wrote :
Revision history for this message
Andrew Poelstra (asp11) wrote :

Confirmed with latest git HEAD.

Changed in pcb:
status: New → Confirmed
assignee: nobody → Andrew Poelstra (asp11)
Revision history for this message
Andrew Poelstra (asp11) wrote :

The problem is that when calculating rat lines, pcb completely ignores non-manhattan lines. See rats.c line 485:

 480 /* now add other possible attachment points to the subnet */
 481 /* e.g. line end-points and vias */
 482 /* don't add non-manhattan lines, the auto-router can't route to them */
 483 ALLLINE_LOOP (PCB->Data);
 484 {
 485 if (TEST_FLAG (DRCFLAG, line)
 486 && ((line->Point1.X == line->Point2.X)
 487 || (line->Point1.Y == line->Point2.Y)))

Removing the check for manhattan lines fixes this bug, but it makes the autorouter segfault. It is not clear to me how to proceed, but there is probably no simple solution.

Revision history for this message
gpleda.org commit robot (gpleda-launchpad-robot) wrote :

Bug was fixed by a commit
git master commit 5cf901321b96dd0a929391a9fad8b6680ee32631
http://git.geda-project.org/pcb/commit/?id=5cf901321b96dd0a929391a9fad8b6680ee32631

commit 5cf901321b96dd0a929391a9fad8b6680ee32631
Author: Andrew Poelstra <email address hidden>
Commit: Andrew Poelstra <email address hidden>

    Remove manhattan check from rats.c

    Since commit 644f8d9, I cannot get the autorouter to segfault when
    it attempts to deal with ratlines connected to non-manhattan lines.
    So, I see no reason not to draw such lines in the first place.

    However, when the autorouter is used, it will ignore any rats which
    lead to a non-manhattan line. (And therefore not connect two points,
    if the shortest connection would involve connecting diagonal traces.)

    This is unexpected behavior, though IMO no more unexpected than the
    old behavior, which was to ignore diagonal line segments and simply
    route amongst the manhattan ones.

    Closes-bug: lp-699248

Changed in pcb:
status: Confirmed → Fix Committed
Changed in pcb:
status: Fix Committed → Fix Released
Changed in pcb:
milestone: none → pcb-20140316
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.