Index: src_plugins/rbs_routing/map.c =================================================================== --- src_plugins/rbs_routing/map.c (revision 38748) +++ src_plugins/rbs_routing/map.c (revision 38749) @@ -26,7 +26,9 @@ */ #include +#include #include +#include #include "obj_pstk_inlines.h" RND_INLINE void make_point_from_pstk_shape(rbsr_map_t *rbs, pcb_pstk_t *ps, pcb_pstk_shape_t *shp, pcb_layer_t *ly) @@ -357,3 +359,37 @@ TODO("free the locally allocated map"); } + +void grbs_draw_wires(grbs_t *grbs, FILE *f); +void grbs_dump_wires(grbs_t *grbs, FILE *f); +void grbs_draw_2net(grbs_t *grbs, FILE *f, grbs_2net_t *tn); +void grbs_dump_2net(grbs_t *grbs, FILE *f, grbs_2net_t *tn); + +void rbsr_map_debug_draw(rbsr_map_t *rbs, const char *fn) +{ + FILE *f = rnd_fopen(&rbs->pcb->hidlib, fn, "w"); + if (f == NULL) { + rnd_message(RND_MSG_ERROR, "Failed to open debug output '%s' for write\n", fn); + return; + } + + grbs_draw_points(&rbs->grbs, f); + grbs_draw_wires(&rbs->grbs, f); + + fclose(f); +} + +void rbsr_map_debug_dump(rbsr_map_t *rbs, const char *fn) +{ + FILE *f = rnd_fopen(&rbs->pcb->hidlib, fn, "w"); + if (f == NULL) { + rnd_message(RND_MSG_ERROR, "Failed to open debug output '%s' for write\n", fn); + return; + } + + grbs_dump_points(&rbs->grbs, f); + grbs_dump_wires(&rbs->grbs, f); + + fclose(f); +} + Index: src_plugins/rbs_routing/map.h =================================================================== --- src_plugins/rbs_routing/map.h (revision 38748) +++ src_plugins/rbs_routing/map.h (revision 38749) @@ -31,3 +31,6 @@ int rbsr_map_pcb(rbsr_map_t *dst, pcb_board_t *pcb, rnd_layer_id_t lid); void rbsr_map_uninit(rbsr_map_t *dst); + +void rbsr_map_debug_draw(rbsr_map_t *rbs, const char *fn); +void rbsr_map_debug_dump(rbsr_map_t *rbs, const char *fn);