Index: trunk/src/find_geo.c =================================================================== --- trunk/src/find_geo.c (revision 26577) +++ trunk/src/find_geo.c (revision 26578) @@ -1067,11 +1067,15 @@ PCB_INLINE pcb_bool_t pcb_isc_pstk_pstk(pcb_pstk_t *ps1, pcb_pstk_t *ps2) { pcb_layer_t *ly; + pcb_pstk_proto_t *proto1, *proto2; int n; + proto1 = pcb_pstk_get_proto(ps1); + proto2 = pcb_pstk_get_proto(ps2); + for(n = 0, ly = PCB->Data->Layer; n < PCB->Data->LayerN; n++,ly++) { - pcb_pstk_shape_t *shape1; - pcb_pstk_shape_t *shape2; + pcb_pstk_shape_t *shape1, *slshape1 = NULL; + pcb_pstk_shape_t *shape2, *slshape2 = NULL; pcb_layer_type_t lyt = pcb_layer_flags_(ly); if (!(lyt & PCB_LYT_COPPER)) /* consider only copper for connections */ @@ -1078,11 +1082,18 @@ continue; shape1 = pcb_pstk_shape_at(PCB, ps1, ly); - if (shape1 == NULL) continue; shape2 = pcb_pstk_shape_at(PCB, ps2, ly); - if (shape2 == NULL) continue; - if (pcb_pstk_shape_intersect(ps1, shape1, ps2, shape2)) return pcb_true; + if ((shape1 != NULL) && (shape2 != NULL) && pcb_pstk_shape_intersect(ps1, shape1, ps2, shape2)) return pcb_true; + + if (proto1->hplated) + slshape1 = pcb_pstk_shape_mech_at(PCB, ps1, ly); + if (proto2->hplated) + slshape2 = pcb_pstk_shape_mech_at(PCB, ps2, ly); + + if ((slshape1 != NULL) && (shape2 != NULL) && pcb_pstk_shape_intersect(ps1, slshape1, ps2, shape2)) return pcb_true; + if ((slshape2 != NULL) && (shape1 != NULL) && pcb_pstk_shape_intersect(ps2, slshape2, ps1, shape1)) return pcb_true; + if ((slshape1 != NULL) && (slshape2 != NULL) && pcb_pstk_shape_intersect(ps1, slshape1, ps2, slshape2)) return pcb_true; } return pcb_false; }