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

Re: gEDA-user: polygon regression in pcb+gl



Peter Clifton wrote:
On Wed, 2011-02-16 at 05:27 +0100, Kai-Martin Knaak wrote:

The current head of his pcb+gl branch omits some polygons in my layouts. See the attached screen shots. The working copy of pcb+gl was pulled from repo.or.cz on December 6th. Unfortunately, I wasn't able to locate the the exact version I pulled, or the commit that started the regression.

Urm - I think the bug got into git HEAD too. I think this commit has
caused a regression, but I'm not quite sure why.

commit 2d8dc8a3a3a55158b4e6278dd9f40588e4111c2d
Author: Ineiev <ineiev@xxxxxxxxxxxxxxxx>
Date:   Sun Dec 12 00:28:48 2010 -0500

    [PATCH] fix bug 2793480 (vias/arcs-to-polygon clearances)
frac_circle(): introduce radius_adjustment factor to make
    the polygon outline the arc rather than connet points on the arc
ArcPolyNoIntersect(): compute number of segments so that
    polygon diverges from the arc no more than 0.02 of
    required thickness; adjust outer "arc" radius like in frac_circle()


Any ideas why?

I made a wrong assumption (segs variable should be at least 1).

diff --git a/src/polygon.c b/src/polygon.c
index c552f3c..0235495 100644
--- a/src/polygon.c
+++ b/src/polygon.c
@@ -498,8 +498,8 @@ ArcPolyNoIntersect (ArcType * a, BDimension thick)
   ry = MAX (a->Height - half, 0);
   segs = 1;
   if(thick > 0)
-    segs = a->Delta * M_PI / 360
-	    * sqrt(sqrt((double)rx*rx + (double)ry*ry)/delta_th/2/thick);
+    segs = MAX (segs, a->Delta * M_PI / 360
+		* sqrt(sqrt((double)rx*rx + (double)ry*ry)/delta_th/2/thick));
   segs = MAX(segs, a->Delta / ARC_ANGLE);

   ang = a->StartAngle;


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