Index: trunk/src/find.h =================================================================== --- trunk/src/find.h (revision 30848) +++ trunk/src/find.h (revision 30849) @@ -43,7 +43,11 @@ typedef struct pcb_find_s pcb_find_t; struct pcb_find_s { /* public config - all-zero uses the original method, except for flag set */ + /* low level (will work with isc calls): */ pcb_coord_t bloat; /* perform intersection tests with one object bloated up by this amount (can be negative for shrinking) */ + unsigned ignore_clearance:1; /* a flag dictated clearance is no excuse for intersection - useful for overlap calculation between objects on different layers */ + + /* high level (ignored by isc calls): */ unsigned stay_layergrp:1; /* do not leave the layer (no padstack hop) */ unsigned allow_noncopper:1; /* also run on non-copper objects */ unsigned list_found:1; /* allow adding objects in the ->found vector */ Index: trunk/src/find_geo.c =================================================================== --- trunk/src/find_geo.c (revision 30848) +++ trunk/src/find_geo.c (revision 30849) @@ -651,7 +651,7 @@ pcb_box_t *Box = (pcb_box_t *) Arc; /* arcs with clearance never touch polys */ - if (PCB_FLAG_TEST(PCB_FLAG_CLEARPOLY, Polygon) && PCB_OBJ_HAS_CLEARANCE(Arc)) + if (!ctx->ignore_clearance && PCB_FLAG_TEST(PCB_FLAG_CLEARPOLY, Polygon) && PCB_OBJ_HAS_CLEARANCE(Arc)) return pcb_false; if (!Polygon->Clipped) return pcb_false; @@ -698,7 +698,7 @@ pcb_polyarea_t *lp; /* lines with clearance never touch polygons */ - if (PCB_FLAG_TEST(PCB_FLAG_CLEARPOLY, Polygon) && PCB_OBJ_HAS_CLEARANCE(Line)) + if (!ctx->ignore_clearance && PCB_FLAG_TEST(PCB_FLAG_CLEARPOLY, Polygon) && PCB_OBJ_HAS_CLEARANCE(Line)) return pcb_false; if (!Polygon->Clipped) return pcb_false; @@ -757,11 +757,11 @@ /* cheat: poly-clear-poly means we did generate the clearance; this shall happen only if there's exactly one poly that is clearing the other */ - if (PCB_FLAG_TEST(PCB_FLAG_CLEARPOLYPOLY, P1)) { + if (!ctx->ignore_clearance && PCB_FLAG_TEST(PCB_FLAG_CLEARPOLYPOLY, P1)) { pcp_cnt++; pcp_gap = P1->Clearance / 2.0; } - if (PCB_FLAG_TEST(PCB_FLAG_CLEARPOLYPOLY, P2)) { + if (!ctx->ignore_clearance && PCB_FLAG_TEST(PCB_FLAG_CLEARPOLYPOLY, P2)) { pcp_cnt++; pcp_gap = P2->Clearance / 2.0; }