[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
Re: gEDA-user: Pads do not clear polygons
On Tue, Dec 04, 2007 at 08:38:17PM -0800, Ben Jackson wrote:
> On Tue, Dec 04, 2007 at 09:21:29AM -0500, John Luciani wrote:
> > Using my ancient version of PCB (2005????) I created a simple PCB by placing
> > my DIP-28-300 footprint on a component-side polygon.
>
> This seems to be the exact same bug I found last week for someone who
> put a bug in the tracker. It's caused by the 'via' (pin) in the middle
> of the 'line' (pad). The outer diameter of the pin is the same as the
> pad, so the pin's thickness is tangent to the line. If you reduce the
> pins (even infinitessimally) it clears correctly.
Ok, I think I know why this happens, and I even have a workaround that
fixes jcl's board. It just breaks other things. :(
The geometry looks like this (use a fixed font):
_______
. ^ .
. / \ .
. . . .
. . . . .
The outer shape represents the rounded pad clearance. The inner shape
represents the round pin clearance. I've "shaded" the uninteresting
parts with ".". Where the top line of the pad touches a corner of the
clearance circle (it doesn't touch flat, it touches at a point, the tip
of the ^ in the pic).
If the pin were slightly smaller, they would not intersect. In that
case the entire contours (the pin and the pad) are classified as INSIDE
or OUTSIDE and then the appropriate hole is discovered.
If the pin were slightly larger, part of it would extent completely
outside the line (ie like __/\__). In that case the two contours are
marked ISECTED and points are created in each at the intersection points.
Then every segment in each is INDIVIDUALLY classified as INSIDE or OUTSIDE.
Then code walks along the contours finding the new combined shape, using
the in/out flags to figure out how to walk around the hole.
The problem arises in the touching case in my original illustration.
The contours are marked ISECTED, however the inner contour is actually
only tangent to the outer line at a point, so the segments in it are ALL
INSIDE. The code that tries to walk around creating the joined contour
doesn't find a starting point, so the combination is "nothing" and thus
the hole vanishes.
I tried simply detecting the case where all edges are INSIDE or OUTSIDE
and promoting the whole contour. This fixes jcl's case and the case I
checked into the tracker last week. However, the debug print I put to
show I'm getting into this case fires on other regression boards and
at least some of those cause incorrect results as well. It also causes
problems in the dicer on some boards.
It might also be possible to fix this by modifying SubS_Rule (which
finds the starting point when subtracting intersecting contours, and
starts on the OUTSIDE), but that's currently beyond my ken.
--
Ben Jackson AD7GD
<ben@xxxxxxx>
http://www.ben.com/
_______________________________________________
geda-user mailing list
geda-user@xxxxxxxxxxxxxx
http://www.seul.org/cgi-bin/mailman/listinfo/geda-user