Index: polygon.html =================================================================== --- polygon.html (nonexistent) +++ polygon.html (revision 10053) @@ -0,0 +1,54 @@ +
+void print_poly(pcb_polygon_t *polygon) +{ + pcb_poly_it_t it; + pcb_polyarea_t *pa; + + /* first, iterate over all islands of a polygon */ + for(pa = pcb_poly_island_first(polygon, &it); pa != NULL; pa = pcb_poly_island_next(&it)) { + pcb_coord_t x, y; + pcb_pline_t *pl; + int go; + + printf(" island\n"); + /* check if we have a contour for the given island */ + pl = pcb_poly_contour(&it); + if (pl != NULL) { + printf(" contour:\n"); + /* iterate over the vectors of the contour */ + for(go = pcb_poly_vect_first(&it, &x, &y); go; go = pcb_poly_vect_next(&it, &x, &y)) { + pcb_printf(" %mm %mm\n", x, y); + } + + /* iterate over all holes within this island */ + for(pl = pcb_poly_hole_first(&it); pl != NULL; pl = pcb_poly_hole_next(&it)) { + printf(" hole:\n"); + /* iterate over the vectors of the given hole */ + for(go = pcb_poly_vect_first(&it, &x, &y); go; go = pcb_poly_vect_next(&it, &x, &y)) { + pcb_printf(" %mm %mm\n", x, y); + } + } + } + } +} +