[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

gEDA-user: New ratsnest polygon behavior



I'm hacking on PCB to make the ratsnest smarter (or at least prettier)
with regard to polygons (planes).

The current code picks an arbitrary point on a rectangular polygon to
be the 'location' of that polygon.  Then it participates in ratsnesting
as usual:  if that one point is the closest to some same-net pad, a rat
is drawn from the corner to the pad.

So my first step was to preferentially connect nets to polygons if the
point to be connected is inside the polgon.  Now instead of daisy-chaining
the ground all over the board, all the ground points (over the plane)
connect to the plane.

Then, to improve the display, I was going to just make them 0-length rats,
with a change to DrawRat to give it a distinctive look:  a small
via-like circle.  The problem with this is that rats must be lines with
endpoints touching the copper parts they join.

So my improvement was to still create the lines to the corner of the plane
as before, but set VIAFLAG on the Rat itself.  The Rats are created so that
the first point is always the non-plane point, and the special draw is as
before, so you just get a donut on the pad/pin instead of a line to the
corner of the polygon.

One small improvement is that if there's a line from a pad to a via, then
the via itself will be the endpoint if it's over a plane, not some random
point along the line.

Now for the quirk:  rats.c is already only considering rectangular polys
for planes.  When I say "inside" above, I am only considering the bounding
box of the rectangle.  The reason is that most pins and pads are not
actually "in" a polygon -- the polygons are all cleared around them (except
for internal planes under surface mount pads).  This works fine UNLESS
you cut an island out of a rectangular plane.  The code will still draw
the donut, even though the plane is not reaching your pad.  This could be
fixed, but it would require more work which I wasn't sure was worthwhile.

(the autorouter could definitely make use of the VIAFLAG info, too)

Example, using Harold's board:

	http://ad7gd.net/misc/tile3-before.png
	http://ad7gd.net/misc/tile3-after.png

-- 
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