Index: trunk/doc-rnd/hacking/renames =================================================================== --- trunk/doc-rnd/hacking/renames (revision 5069) +++ trunk/doc-rnd/hacking/renames (revision 5070) @@ -1127,3 +1127,7 @@ PBO_ISECT -> PCB_PBO_ISECT PBO_SUB -> PCB_PBO_SUB PBO_XOR -> PCB_PBO_XOR +POLY_CIRC_SEGS -> PCB_POLY_CIRC_SEGS +POLY_CIRC_SEGS_F -> PCB_POLY_CIRC_SEGS_F +POLY_CIRC_RADIUS_ADJ -> PCB_POLY_CIRC_RADIUS_ADJ +POLY_ARC_MAX_DEVIATION -> PCB_POLY_ARC_MAX_DEVIATION Index: trunk/src/obj_arc.c =================================================================== --- trunk/src/obj_arc.c (revision 5069) +++ trunk/src/obj_arc.c (revision 5070) @@ -121,7 +121,7 @@ width = (Arc->Thickness + Arc->Clearance) / 2; /* Adjust for our discrete polygon approximation */ - width = (double) width *MAX(POLY_CIRC_RADIUS_ADJ, (1.0 + POLY_ARC_MAX_DEVIATION)) + 0.5; + width = (double) width *MAX(PCB_POLY_CIRC_RADIUS_ADJ, (1.0 + PCB_POLY_ARC_MAX_DEVIATION)) + 0.5; Arc->BoundingBox.X1 -= width; Arc->BoundingBox.X2 += width; Index: trunk/src/obj_line.c =================================================================== --- trunk/src/obj_line.c (revision 5069) +++ trunk/src/obj_line.c (revision 5070) @@ -227,7 +227,7 @@ pcb_coord_t width = (Line->Thickness + Line->Clearance + 1) / 2; /* Adjust for our discrete polygon approximation */ - width = (double) width *POLY_CIRC_RADIUS_ADJ + 0.5; + width = (double) width *PCB_POLY_CIRC_RADIUS_ADJ + 0.5; Line->BoundingBox.X1 = MIN(Line->Point1.X, Line->Point2.X) - width; Line->BoundingBox.X2 = MAX(Line->Point1.X, Line->Point2.X) + width; Index: trunk/src/obj_pad.c =================================================================== --- trunk/src/obj_pad.c (revision 5069) +++ trunk/src/obj_pad.c (revision 5070) @@ -129,7 +129,7 @@ } else { /* Adjust for our discrete polygon approximation */ - width = (double) width *POLY_CIRC_RADIUS_ADJ + 0.5; + width = (double) width *PCB_POLY_CIRC_RADIUS_ADJ + 0.5; Pad->BoundingBox.X1 = MIN(Pad->Point1.X, Pad->Point2.X) - width; Pad->BoundingBox.X2 = MAX(Pad->Point1.X, Pad->Point2.X) + width; Index: trunk/src/obj_pinvia.c =================================================================== --- trunk/src/obj_pinvia.c (revision 5069) +++ trunk/src/obj_pinvia.c (revision 5070) @@ -220,7 +220,7 @@ width = MAX(Pin->Clearance + PIN_SIZE(Pin), Pin->Mask) / 2; /* Adjust for our discrete polygon approximation */ - width = (double) width *POLY_CIRC_RADIUS_ADJ + 0.5; + width = (double) width *PCB_POLY_CIRC_RADIUS_ADJ + 0.5; Pin->BoundingBox.X1 = Pin->X - width; Pin->BoundingBox.Y1 = Pin->Y - width; Index: trunk/src/polygon.c =================================================================== --- trunk/src/polygon.c (revision 5069) +++ trunk/src/polygon.c (revision 5070) @@ -104,8 +104,8 @@ void pcb_polygon_init(void) { - double cos_ang = cos(2.0 * M_PI / POLY_CIRC_SEGS_F); - double sin_ang = sin(2.0 * M_PI / POLY_CIRC_SEGS_F); + double cos_ang = cos(2.0 * M_PI / PCB_POLY_CIRC_SEGS_F); + double sin_ang = sin(2.0 * M_PI / PCB_POLY_CIRC_SEGS_F); rotate_circle_seg[0] = cos_ang; rotate_circle_seg[1] = -sin_ang; @@ -404,11 +404,11 @@ pcb_poly_vertex_include(c->head.prev, pcb_poly_node_create(v)); /* move vector to origin */ - e1 = (v[0] - X) * POLY_CIRC_RADIUS_ADJ; - e2 = (v[1] - Y) * POLY_CIRC_RADIUS_ADJ; + e1 = (v[0] - X) * PCB_POLY_CIRC_RADIUS_ADJ; + e2 = (v[1] - Y) * PCB_POLY_CIRC_RADIUS_ADJ; /* NB: the caller adds the last vertex, hence the -1 */ - range = POLY_CIRC_SEGS / range - 1; + range = PCB_POLY_CIRC_SEGS / range - 1; for (i = 0; i < range; i++) { /* rotate the vector */ t1 = rotate_circle_seg[0] * e1 + rotate_circle_seg[1] * e2; @@ -494,7 +494,7 @@ segs = 1; if (thick > 0) segs = MAX(segs, a->Delta * M_PI / 360 * - sqrt(sqrt((double) rx * rx + (double) ry * ry) / POLY_ARC_MAX_DEVIATION / 2 / thick)); + sqrt(sqrt((double) rx * rx + (double) ry * ry) / PCB_POLY_ARC_MAX_DEVIATION / 2 / thick)); segs = MAX(segs, a->Delta / ARC_ANGLE); ang = a->StartAngle; Index: trunk/src/polygon.h =================================================================== --- trunk/src/polygon.h (revision 5069) +++ trunk/src/polygon.h (revision 5070) @@ -37,17 +37,17 @@ /* Implementation constants */ -#define POLY_CIRC_SEGS 40 -#define POLY_CIRC_SEGS_F ((float)POLY_CIRC_SEGS) +#define PCB_POLY_CIRC_SEGS 40 +#define PCB_POLY_CIRC_SEGS_F ((float)PCB_POLY_CIRC_SEGS) /* adjustment to make the segments outline the circle rather than connect * points on the circle: 1 - cos (\alpha / 2) < (\alpha / 2) ^ 2 / 2 */ -#define POLY_CIRC_RADIUS_ADJ (1.0 + M_PI / POLY_CIRC_SEGS_F * \ - M_PI / POLY_CIRC_SEGS_F / 2.0) +#define PCB_POLY_CIRC_RADIUS_ADJ (1.0 + M_PI / PCB_POLY_CIRC_SEGS_F * \ + M_PI / PCB_POLY_CIRC_SEGS_F / 2.0) /* polygon diverges from modelled arc no more than MAX_ARC_DEVIATION * thick */ -#define POLY_ARC_MAX_DEVIATION 0.02 +#define PCB_POLY_ARC_MAX_DEVIATION 0.02 /* Prototypes */