Index: trunk/src/thermal.c =================================================================== --- trunk/src/thermal.c (revision 31813) +++ trunk/src/thermal.c (revision 31814) @@ -109,7 +109,29 @@ return NULL; } +void pcb_thermal_bits2chars(char dst[3], pcb_thermal_t bits) +{ + char *end = dst; + if (!(bits & PCB_THERMAL_ON)) { + *end = '\0'; + return; + } + + switch(bits & 3) { + case PCB_THERMAL_NOSHAPE: *end++ = 'n'; break; + case PCB_THERMAL_ROUND: *end++ = 'o'; break; + case PCB_THERMAL_SHARP: *end++ = 'x'; break; + case PCB_THERMAL_SOLID: *end++ = '@'; break; + } + + if (bits & PCB_THERMAL_DIAGONAL) + *end++ = 'd'; + + *end++ = '\0'; +} + + /* generate a round-cap line polygon */ static rnd_polyarea_t *pa_line_at(double x1, double y1, double x2, double y2, rnd_coord_t clr, rnd_bool square) { Index: trunk/src/thermal.h =================================================================== --- trunk/src/thermal.h (revision 31813) +++ trunk/src/thermal.h (revision 31814) @@ -54,7 +54,14 @@ all words. */ const char *pcb_thermal_bits2str(pcb_thermal_t *bits); +/* Converts all bits of a thermal bitmask to a string that is: + - empty if there is no thermal + - starts with n, o, x or @ for no-shape, round, sharp or solid + - ends in d if diagonal +*/ +void pcb_thermal_bits2chars(char dst[3], pcb_thermal_t bits); + rnd_polyarea_t *pcb_thermal_area(pcb_board_t *p, pcb_any_obj_t *obj, rnd_layer_id_t lid, pcb_poly_t *in_poly); rnd_polyarea_t *pcb_thermal_area_line(pcb_board_t *pcb, pcb_line_t *line, rnd_layer_id_t lid, pcb_poly_t *in_poly); rnd_polyarea_t *pcb_thermal_area_poly(pcb_board_t *pcb, pcb_poly_t *poly, rnd_layer_id_t lid, pcb_poly_t *in_poly);