Index: trunk/src/find_geo.c =================================================================== --- trunk/src/find_geo.c (revision 34997) +++ trunk/src/find_geo.c (revision 34998) @@ -1152,10 +1152,22 @@ { pcb_pstk_shape_t *shape; pcb_pstk_proto_t *proto; + rnd_coord_t clr; if (anylayer) PCB_ISC_PSTK_ANYLAYER(ps, pcb_isc_pstk_poly_shp(ctx, ps, poly, &tshp->shape[n])); + /* optimization: if thre's a clearance between the padstack and the poly, no + need to calculate anything */ + clr = pcb_obj_clearance_at(PCB, (pcb_any_obj_t *)ps, poly->parent.layer); + if (clr > 0) { + unsigned char *thr = pcb_pstk_get_thermal(ps, pcb_layer2id(PCB->Data, poly->parent.layer), 0); + + /* but only if there's no thermal that'd connect it through the clearance */ + if ((thr == NULL) || (!(*thr & PCB_THERMAL_ON) || ((*thr & 0x07) == PCB_THERMAL_NOSHAPE))) + return rnd_false; + } + shape = pcb_pstk_shape_at(PCB, ps, poly->parent.layer); if (pcb_isc_pstk_poly_shp(ctx, ps, poly, shape)) return rnd_true;