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

Re: gEDA-user: PCB: DRC does not correctly check pad clearance



On 02/21/2011 02:06 PM, Peter C.J. Clifton wrote:
On Feb 21 2011, Ineiev wrote:

It looks like Bloat in IsLineInPolygon() should be doubled like in the
attachment.

Sounds about right - of this appears to fix the problem for the OP, please commit the fix ;)

It doesn't actually fix IsLineInPolygon():

===
if (TEST_FLAG(SQUAREFLAG,Line)&&(Line->Point1.X==Line->Point2.X||Line->Point1.Y==Line->Point2.Y))
     {
       BDimension wid = (Line->Thickness + 1) / 2 + Bloat;
       LocationType x1, x2, y1, y2;

       x1 = MIN (Line->Point1.X, Line->Point2.X) - wid;
       y1 = MIN (Line->Point1.Y, Line->Point2.Y) - wid;
       x2 = MAX (Line->Point1.X, Line->Point2.X) + wid;
       y2 = MAX (Line->Point1.Y, Line->Point2.Y) + wid;
       return IsRectangleInPolygon (x1, y1, x2, y2, Polygon);
     }
  if (Box->X1 <= Polygon->Clipped->contours->xmax + Bloat
&& Box->X2 >= Polygon->Clipped->contours->xmin - Bloat
&& Box->Y1 <= Polygon->Clipped->contours->ymax + Bloat
&& Box->Y2 >= Polygon->Clipped->contours->ymin - Bloat)
    {
      if (!(lp = LinePoly (Line, Line->Thickness + Bloat * 2)))
        return FALSE;           /* error */
      return isects (lp, Polygon, true);
    }
===

First, IsRectangleInPolygon() won't do when Bloat > 0;
Second, LinePoly() should be fixed for squared lines case
(it should redirect these cases to SquarePadPoly()).

So, the fix is not going to be trivial and will need more care.


_______________________________________________
geda-user mailing list
geda-user@xxxxxxxxxxxxxx
http://www.seul.org/cgi-bin/mailman/listinfo/geda-user