Index: trunk/src/find_geo.c =================================================================== --- trunk/src/find_geo.c (revision 15684) +++ trunk/src/find_geo.c (revision 15685) @@ -64,7 +64,7 @@ pcb_is_point_on_arc((PV)->X,(PV)->Y,MAX((PV)->Thickness/2.0 + Bloat,0.0), (Arc))) #define IS_PV_ON_PAD(PV,Pad) \ - ( pcb_is_point_in_pad((PV)->X, (PV)->Y, MAX((PV)->Thickness/2 +Bloat,0), (Pad))) + ( pcb_is_point_in_line((PV)->X, (PV)->Y, MAX((PV)->Thickness/2 +Bloat,0), (Pad))) /* reduce arc start angle and delta to 0..360 */ static void normalize_angles(pcb_angle_t * sa, pcb_angle_t * d) @@ -399,10 +399,10 @@ * cases where the "real" lines don't intersect but the * thick lines touch, and ensures that the dx/dy business * below does not cause a divide-by-zero. */ - if (pcb_is_point_in_pad(Line2->Point1.X, Line2->Point1.Y, MAX(Line2->Thickness / 2 + Bloat, 0), (pcb_pad_t *) Line1) - || pcb_is_point_in_pad(Line2->Point2.X, Line2->Point2.Y, MAX(Line2->Thickness / 2 + Bloat, 0), (pcb_pad_t *) Line1) - || pcb_is_point_in_pad(Line1->Point1.X, Line1->Point1.Y, MAX(Line1->Thickness / 2 + Bloat, 0), (pcb_pad_t *) Line2) - || pcb_is_point_in_pad(Line1->Point2.X, Line1->Point2.Y, MAX(Line1->Thickness / 2 + Bloat, 0), (pcb_pad_t *) Line2)) + if (pcb_is_point_in_line(Line2->Point1.X, Line2->Point1.Y, MAX(Line2->Thickness / 2 + Bloat, 0), (pcb_pad_t *) Line1) + || pcb_is_point_in_line(Line2->Point2.X, Line2->Point2.Y, MAX(Line2->Thickness / 2 + Bloat, 0), (pcb_pad_t *) Line1) + || pcb_is_point_in_line(Line1->Point1.X, Line1->Point1.Y, MAX(Line1->Thickness / 2 + Bloat, 0), (pcb_pad_t *) Line2) + || pcb_is_point_in_line(Line1->Point2.X, Line1->Point2.Y, MAX(Line1->Thickness / 2 + Bloat, 0), (pcb_pad_t *) Line2)) return pcb_true; /* setup some constants */ @@ -428,7 +428,7 @@ /* No cross product means parallel lines, or maybe Line2 is * zero-length. In either case, since we did a bounding-box - * check before getting here, the above pcb_is_point_in_pad() checks + * check before getting here, the above pcb_is_point_in_line() checks * will have caught any intersections. */ if (r == 0.0) return pcb_false; @@ -515,11 +515,11 @@ /* check arc end points */ pcb_arc_get_end(Arc, 0, &ex, &ey); - if (pcb_is_point_in_pad(ex, ey, Arc->Thickness * 0.5 + Bloat, (pcb_pad_t *) Line)) + if (pcb_is_point_in_line(ex, ey, Arc->Thickness * 0.5 + Bloat, (pcb_pad_t *) Line)) return pcb_true; pcb_arc_get_end(Arc, 1, &ex, &ey); - if (pcb_is_point_in_pad(ex, ey, Arc->Thickness * 0.5 + Bloat, (pcb_pad_t *) Line)) + if (pcb_is_point_in_line(ex, ey, Arc->Thickness * 0.5 + Bloat, (pcb_pad_t *) Line)) return pcb_true; return pcb_false; } @@ -799,7 +799,7 @@ tmp.Point2.Y = line->Point2.Y; tmp.Thickness = line->Thickness; tmp.Flags = pcb_no_flags(); - return pcb_is_point_in_pad(shape->data.circ.x + ps->x, shape->data.circ.y + ps->y, shape->data.circ.dia/2, &tmp); + return pcb_is_point_in_line(shape->data.circ.x + ps->x, shape->data.circ.y + ps->y, shape->data.circ.dia/2, &tmp); } } return pcb_false; @@ -921,7 +921,7 @@ tmp.Point2.Y = sl->data.line.y2 + l->y; tmp.Thickness = sl->data.line.thickness; tmp.Flags = pcb_no_flags(); - return pcb_is_point_in_pad(sc->data.circ.x + c->x, sc->data.circ.y + c->y, sc->data.circ.dia/2, &tmp); + return pcb_is_point_in_line(sc->data.circ.x + c->x, sc->data.circ.y + c->y, sc->data.circ.dia/2, &tmp); } PCB_INLINE pcb_bool_t pcb_pstk_shape_intersect(pcb_pstk_t *ps1, pcb_pstk_shape_t *shape1, pcb_pstk_t *ps2, pcb_pstk_shape_t *shape2) Index: trunk/src/obj_pstk.c =================================================================== --- trunk/src/obj_pstk.c (revision 15684) +++ trunk/src/obj_pstk.c (revision 15685) @@ -706,7 +706,7 @@ pad.Thickness = shape->data.line.thickness; pad.Clearance = 0; pad.Flags = pcb_flag_make(shape->data.line.square ? PCB_FLAG_SQUARE : 0); - return pcb_is_point_in_pad(x, y, radius, &pad); + return pcb_is_point_in_line(x, y, radius, &pad); case PCB_PSSH_POLY: if (shape->data.poly.pa == NULL) pcb_pstk_shape_update_pa(&shape->data.poly); Index: trunk/src/search.c =================================================================== --- trunk/src/search.c (revision 15684) +++ trunk/src/search.c (revision 15685) @@ -154,7 +154,7 @@ TEST_OBJST(i->objst, i->req_flag, l, l, l); - if (!pcb_is_point_in_pad(PosX, PosY, SearchRadius, (pcb_pad_t *) l)) + if (!pcb_is_point_in_line(PosX, PosY, SearchRadius, (pcb_pad_t *) l)) return PCB_R_DIR_NOT_FOUND; *i->Line = l; *i->Point = (pcb_point_t *) l; @@ -847,10 +847,10 @@ } /* --------------------------------------------------------------------------- - * Check if a circle of Radius with center at (X, Y) intersects a Pad. - * Written to enable arbitrary pad directions; for rounded pads, too. + * Check if a circle of Radius with center at (X, Y) intersects a line. + * Written to enable arbitrary line directions; for rounded/square lines, too. */ -pcb_bool pcb_is_point_in_pad(pcb_coord_t X, pcb_coord_t Y, pcb_coord_t Radius, pcb_pad_t *Pad) +pcb_bool pcb_is_point_in_line(pcb_coord_t X, pcb_coord_t Y, pcb_coord_t Radius, pcb_any_line_t *Pad) { double r, Sin, Cos; pcb_coord_t x; @@ -858,7 +858,7 @@ /* Also used from line_callback with line type smaller than pad type; use the smallest common subset; ->Thickness is still ok. */ pcb_coord_t t2 = (Pad->Thickness + 1) / 2, range; - pcb_any_line_t pad = *(pcb_any_line_t *) Pad; + pcb_any_line_t pad = *Pad; /* series of transforms saving range */ Index: trunk/src/search.h =================================================================== --- trunk/src/search.h (revision 15684) +++ trunk/src/search.h (revision 15685) @@ -171,7 +171,7 @@ pcb_bool pcb_is_line_in_rectangle(pcb_coord_t X1, pcb_coord_t Y1, pcb_coord_t X2, pcb_coord_t Y2, pcb_line_t *Line); pcb_bool pcb_is_line_in_quadrangle(pcb_point_t p[4], pcb_line_t *Line); pcb_bool pcb_is_arc_in_rectangle(pcb_coord_t X1, pcb_coord_t Y1, pcb_coord_t X2, pcb_coord_t Y2, pcb_arc_t *Arc); -pcb_bool pcb_is_point_in_pad(pcb_coord_t X, pcb_coord_t Y, pcb_coord_t Radius, pcb_pad_t *Pad); +pcb_bool pcb_is_point_in_line(pcb_coord_t X, pcb_coord_t Y, pcb_coord_t Radius, pcb_any_line_t *Pad); pcb_bool pcb_is_point_in_box(pcb_coord_t X, pcb_coord_t Y, pcb_box_t *box, pcb_coord_t Radius); /* Return the distance^2 between a line-center and a point */ Index: trunk/src_plugins/lib_compat_help/pstk_help.c =================================================================== --- trunk/src_plugins/lib_compat_help/pstk_help.c (revision 15684) +++ trunk/src_plugins/lib_compat_help/pstk_help.c (revision 15685) @@ -159,7 +159,7 @@ if (PCB_FLAG_TEST(PCB_FLAG_FOUND, c)) continue; /* already used */ switch(c->type) { case PCB_OBJ_LINE: - if (!pcb_is_point_in_pad(cx, cy, r, (pcb_pad_t *)c)) continue; + if (!pcb_is_point_in_line(cx, cy, r, (pcb_pad_t *)c)) continue; break; case PCB_OBJ_POLY: if (!pcb_poly_is_point_in_p(cx, cy, r, (pcb_poly_t *)c)) continue;