Index: trunk/src/obj_pstk_inlines.h =================================================================== --- trunk/src/obj_pstk_inlines.h (revision 32747) +++ trunk/src/obj_pstk_inlines.h (revision 32748) @@ -332,18 +332,14 @@ return pcb_pstk_shape_mech_gid(pcb, ps, layer->meta.real.grp); } -/* Returns a shape correspinding to the hole or the mech shape (slot) if - it affects layer; hole shape is created in holetmp */ -RND_INLINE pcb_pstk_shape_t *pcb_pstk_shape_mech_or_hole_at(pcb_board_t *pcb, pcb_pstk_t *ps, pcb_layer_t *layer, pcb_pstk_shape_t *holetmp) +/* Returns a shape corresponding to the hole or the mech shape (slot) regardless + of layers. + *DO NOT USE*, this call is designed for padstack internal code. Use + pcb_pstk_shape_mech_or_hole_at() instead. (Hole shape is created in holetmp) */ +RND_INLINE pcb_pstk_shape_t *pcb_pstk_shape_mech_or_hole_(pcb_pstk_t *ps, pcb_pstk_proto_t *proto, pcb_pstk_shape_t *holetmp) { pcb_pstk_tshape_t *ts; - pcb_pstk_proto_t *proto; - layer = pcb_layer_get_real(layer); - - if (!pcb_pstk_bb_drills(pcb, ps, pcb_layer_get_group_(layer), &proto)) - return NULL; - /* hole has priority */ if (proto->hdia > 0) { holetmp->shape = PCB_PSSH_CIRC; @@ -360,6 +356,20 @@ return ts->shape + proto->mech_idx; } +/* Returns a shape corresponding to the hole or the mech shape (slot) if + it affects layer; hole shape is created in holetmp */ +RND_INLINE pcb_pstk_shape_t *pcb_pstk_shape_mech_or_hole_at(pcb_board_t *pcb, pcb_pstk_t *ps, pcb_layer_t *layer, pcb_pstk_shape_t *holetmp) +{ + pcb_pstk_proto_t *proto; + + layer = pcb_layer_get_real(layer); + + if (!pcb_pstk_bb_drills(pcb, ps, pcb_layer_get_group_(layer), &proto)) + return NULL; + + return pcb_pstk_shape_mech_or_hole_(ps, proto, holetmp); +} + /* Return the shape of the hshadow, if it is not the same as the forbidden shape. The forbidden shape should be the shape that triggers the lookup. tmpshp should be a local temporary shape where the circular shape for a Index: trunk/src/obj_pstk_proto.c =================================================================== --- trunk/src/obj_pstk_proto.c (revision 32747) +++ trunk/src/obj_pstk_proto.c (revision 32748) @@ -72,6 +72,7 @@ dst->mech_idx = -1; if (ts != NULL) { + /* find and cache the index of the mech shape (slot) */ for(n = 0; n < ts->len; n++) { if (ts->shape[n].layer_mask & PCB_LYT_MECH) { dst->mech_idx = n; @@ -78,6 +79,10 @@ break; } } + + /* mark each copper shape with whether it overlaps with the hole/mech shape or not */ + for(n = 0; n < ts->len; n++) { + } } }