Index: trunk/src_plugins/lib_netmap/map_2nets.h =================================================================== --- trunk/src_plugins/lib_netmap/map_2nets.h (revision 35007) +++ trunk/src_plugins/lib_netmap/map_2nets.h (revision 35008) @@ -60,6 +60,9 @@ pcb_poly_t poly; pcb_text_t text; } o; + + /* internal/cache */ + unsigned char cc; /* ends used for connection */ } pcb_2netmap_obj_t; typedef struct pcb_2netmap_oseg_s pcb_2netmap_oseg_t; Index: trunk/src_plugins/lib_netmap/map_2nets_geo.c =================================================================== --- trunk/src_plugins/lib_netmap/map_2nets_geo.c (revision 35007) +++ trunk/src_plugins/lib_netmap/map_2nets_geo.c (revision 35008) @@ -116,3 +116,37 @@ return 0; } + +/* Loads ox and oy with the coordinate of the intersection between trace objects + a and b. Also loads enda and endb with the endpoint bit (1 or 2 for ends; 0 + for middle) */ +static int map_seg_get_isc_coords(pcb_any_obj_t *a, pcb_any_obj_t *b, int *enda, int *endb, rnd_coord_t *ox, rnd_coord_t *oy) +{ + rnd_angle_t ang; + + if ((a->type == PCB_OBJ_LINE) && (map_seg_get_end_coords_on_line(b, (pcb_line_t *)a, ox, oy) == 0)) { + return 0; + } + + if ((b->type == PCB_OBJ_LINE) && (map_seg_get_end_coords_on_line(a, (pcb_line_t *)b, ox, oy) == 0)) { + return 0; + } + + + if ((a->type == PCB_OBJ_ARC) && (map_seg_get_end_coords_on_arc(b, (pcb_arc_t *)a, &ang) == 0)) { + if (pcb_arc_get_xy((pcb_arc_t *)a, ang, ox, oy) != 0) + return -1; + + return 0; + } + + if ((b->type == PCB_OBJ_ARC) && (map_seg_get_end_coords_on_arc(a, (pcb_arc_t *)b, &ang) == 0)) { + if (pcb_arc_get_xy((pcb_arc_t *)b, ang, ox, oy) != 0) + return -1; + + return 0; + } + + return -1; +} + Index: trunk/src_plugins/lib_netmap/map_2nets_map.c =================================================================== --- trunk/src_plugins/lib_netmap/map_2nets_map.c (revision 35007) +++ trunk/src_plugins/lib_netmap/map_2nets_map.c (revision 35008) @@ -69,6 +69,21 @@ return i->seg->objs.array[0]; } + +static pcb_any_obj_t *map_seg_out_coords(pcb_2netmap_t *map, pcb_2netmap_oseg_t *o, pcb_2netmap_iseg_t *i, int start_side) +{ + long n; + if (start_side == 0) { + for(n = 0; n < i->seg->objs.used; n++) + vtp0_append(&o->objs, map_seg_out_obj(map, i->seg->objs.array[n])); + return i->seg->objs.array[i->seg->objs.used-1]; + } + + for(n = i->seg->objs.used-1; n >= 0; n--) + vtp0_append(&o->objs, map_seg_out_obj(map, i->seg->objs.array[n])); + return i->seg->objs.array[0]; +} + /* replace a hub object with a dummy object that acts as a bridge between 'from' object and the starting object of to_iseg */ static void map_seg_add_bridge(pcb_2netmap_t *map, pcb_2netmap_oseg_t *oseg, pcb_any_obj_t *from, pcb_any_obj_t *hub_obj, pcb_2netmap_iseg_t *to_iseg, int to_start_side) @@ -125,6 +140,21 @@ vtp0_append(&oseg->objs, tmp); } +static void oseg_map_coords(pcb_2netmap_t *map, pcb_2netmap_oseg_t *oseg) +{ + long n; + pcb_2netmap_obj_t *curr, *prev = NULL; + + /* find connected endpoints */ + for(n = 0; n < oseg->objs.used; n++) { + curr = oseg->objs.array[n]; + if (prev != NULL) { + + } + prev = curr; + } +} + static void map_seg_out(pcb_2netmap_t *map, pcb_2netmap_iseg_t *iseg) { pcb_2netmap_iseg_t *prev, *es; @@ -175,6 +205,8 @@ else start_side = 1; } + + oseg_map_coords(map, oseg); } /*** Search a path from a starting segment to any terminal using the A* algorithm ***/