Index: trunk/src/obj_common.h =================================================================== --- trunk/src/obj_common.h (revision 31067) +++ trunk/src/obj_common.h (revision 31068) @@ -290,6 +290,11 @@ return (size_t)obj / pcb_size_class(sizeof(pcb_any_obj_t)); } +/* Assuming clearance is happening (flags), clearance of an object + in a polygon is the bigger of the obj's ->clearance and the polygon's + ->enforce_clearance */ +#define pcb_obj_clearance(obj, in_poly) \ + (RND_MAX((obj)->Clearance, (in_poly)->enforce_clearance)) #define pcb_obj_id_reg(data, obj) \ do { \ Index: trunk/src/obj_poly.h =================================================================== --- trunk/src/obj_poly.h (revision 31067) +++ trunk/src/obj_poly.h (revision 31068) @@ -39,6 +39,7 @@ struct pcb_poly_s { /* holds information about a polygon */ PCB_ANY_PRIMITIVE_FIELDS; rnd_coord_t Clearance; + rnd_coord_t enforce_clearance; /* all objects within this polygon needs to have at least this much clearance */ rnd_cardinal_t PointN; /* number of points in polygon */ rnd_cardinal_t PointMax; /* max number from malloc() */ rnd_polyarea_t *Clipped; /* the clipped region of this polygon */