Index: trunk/src/polygon.c =================================================================== --- trunk/src/polygon.c (revision 12424) +++ trunk/src/polygon.c (revision 12425) @@ -994,7 +994,6 @@ ret = tmp; \ } while(0) - /* Construct a poly area that represents the enlarged subpoly - so it can be subtracted from the parent poly to form the clearance for subpoly */ static pcb_polyarea_t *SubtractPolyPoly_construct(pcb_poly_t *subpoly) @@ -1041,6 +1040,15 @@ return ret; } +/* return the clearance polygon for a line */ +static pcb_polyarea_t *poly_clearance_poly(pcb_cardinal_t layernum, pcb_board_t *pcb, pcb_poly_t *subpoly) +{ + if (subpoly->thermal & PCB_THERMAL_ON) + return pcb_thermal_area_poly(pcb, subpoly, layernum); + return SubtractPolyPoly_construct(subpoly); +} + + static int SubtractPolyPoly(pcb_poly_t *subpoly, pcb_poly_t *frompoly) { pcb_polyarea_t *pa; @@ -1048,7 +1056,7 @@ if (PCB_FLAG_TEST(PCB_FLAG_CLEARPOLYPOLY, frompoly)) /* two clearing polys won't interact */ return -1; - pa = SubtractPolyPoly_construct(subpoly); + pa = poly_clearance_poly(-1, NULL, subpoly); if (pa == NULL) return -1; @@ -1065,7 +1073,7 @@ if (PCB_FLAG_TEST(PCB_FLAG_CLEARPOLYPOLY, frompoly)) /* two clearing polys won't interact */ return -1; - pa = SubtractPolyPoly_construct(subpoly); + pa = poly_clearance_poly(-1, NULL, subpoly); if (pa == NULL) return -1; Index: trunk/src/thermal.h =================================================================== --- trunk/src/thermal.h (revision 12424) +++ trunk/src/thermal.h (revision 12425) @@ -52,5 +52,6 @@ pcb_polyarea_t *pcb_thermal_area(pcb_board_t *p, pcb_any_obj_t *obj, pcb_layer_id_t lid); pcb_polyarea_t *pcb_thermal_area_pin(pcb_board_t *pcb, pcb_pin_t *pin, pcb_layer_id_t lid); pcb_polyarea_t *pcb_thermal_area_line(pcb_board_t *pcb, pcb_line_t *line, pcb_layer_id_t lid); +pcb_polyarea_t *pcb_thermal_area_poly(pcb_board_t *pcb, pcb_poly_t *poly, pcb_layer_id_t lid); #endif