Index: trunk/src/find_any_isect.c =================================================================== --- trunk/src/find_any_isect.c (revision 21840) +++ trunk/src/find_any_isect.c (revision 21841) @@ -114,7 +114,7 @@ case PCB_OBJ_POLY: return pcb_isc_rat_poly((pcb_rat_t *)a, (pcb_poly_t *)b); case PCB_OBJ_ARC: return pcb_isc_rat_arc((pcb_rat_t *)a, (pcb_arc_t *)b); case PCB_OBJ_PSTK: TODO("find: rat vs. padstack"); - case PCB_OBJ_RAT: TODO("find: rat vs. rat"); + case PCB_OBJ_RAT: return pcb_isc_rat_rat((pcb_rat_t *)a, (pcb_rat_t *)b); default:; } break; Index: trunk/src/find_geo.c =================================================================== --- trunk/src/find_geo.c (revision 21840) +++ trunk/src/find_geo.c (revision 21841) @@ -322,6 +322,20 @@ return pcb_false; } +/* Tests any end of a rat line is on the other rat */ +static pcb_bool pcb_isc_rat_rat(pcb_rat_t *r1, pcb_rat_t *r2) +{ + if ((r1->group1 == r2->group1) && (r1->Point1.X == r2->Point1.X) && (r1->Point1.Y == r2->Point1.Y)) + return pcb_true; + if ((r1->group2 == r2->group2) && (r1->Point2.X == r2->Point2.X) && (r1->Point2.Y == r2->Point2.Y)) + return pcb_true; + if ((r1->group1 == r2->group2) && (r1->Point1.X == r2->Point2.X) && (r1->Point1.Y == r2->Point2.Y)) + return pcb_true; + if ((r1->group2 == r2->group1) && (r1->Point2.X == r2->Point1.X) && (r1->Point2.Y == r2->Point1.Y)) + return pcb_true; + return pcb_false; +} + static void form_slanted_rectangle(pcb_point_t p[4], pcb_line_t *l) /* writes vertices of a squared line */ {