Index: trunk/src/obj_subc.c =================================================================== --- trunk/src/obj_subc.c (revision 22245) +++ trunk/src/obj_subc.c (revision 22246) @@ -273,7 +273,7 @@ return 0; } -int pcb_subc_get_host_trans(pcb_subc_t *sc, pcb_host_trans_t *tr) +int pcb_subc_get_host_trans(pcb_subc_t *sc, pcb_host_trans_t *tr, int neg) { int res = 0; double rr; @@ -294,6 +294,13 @@ } rr = tr->rot / PCB_RAD_TO_DEG; + + if (neg) { + tr->rot = -tr->rot; + tr->ox = -tr->ox; + tr->oy = -tr->oy; + } + tr->cosa = cos(rr); tr->sina = sin(rr); Index: trunk/src/obj_subc.h =================================================================== --- trunk/src/obj_subc.h (revision 22245) +++ trunk/src/obj_subc.h (revision 22246) @@ -114,8 +114,12 @@ int pcb_subc_get_origin(pcb_subc_t *sc, pcb_coord_t *x, pcb_coord_t *y); int pcb_subc_get_rotation(pcb_subc_t *sc, double *rot); int pcb_subc_get_side(pcb_subc_t *sc, int *on_bottom); -int pcb_subc_get_host_trans(pcb_subc_t *sc, pcb_host_trans_t *tr); +/* get all the above transformatoins at once. If neg is 0, these are the + raw transofrmations ("what happened to the subc from neutral state"), + if neg is non-zero, these are the transformations back to neutral state. */ +int pcb_subc_get_host_trans(pcb_subc_t *sc, pcb_host_trans_t *tr, int neg); + /* Search for the named subc; name is relative path in hierarchy. Returns NULL if not found */ pcb_subc_t *pcb_subc_by_refdes(pcb_data_t *base, const char *name); Index: trunk/src/obj_subc_hash.c =================================================================== --- trunk/src/obj_subc_hash.c (revision 22245) +++ trunk/src/obj_subc_hash.c (revision 22246) @@ -57,8 +57,8 @@ if (arclist_length(&ly1->Arc) != arclist_length(&ly2->Arc)) return 0; } - pcb_subc_get_host_trans(sc1, &tr1); - pcb_subc_get_host_trans(sc2, &tr2); + pcb_subc_get_host_trans(sc1, &tr1, 1); + pcb_subc_get_host_trans(sc2, &tr2, 1); for(lid = 0; lid < sc1->data->LayerN; lid++) { pcb_line_t *l1, *l2; @@ -117,7 +117,7 @@ pcb_host_trans_t tr; gdl_iterator_t it; - pcb_subc_get_host_trans(sc, &tr); + pcb_subc_get_host_trans(sc, &tr, 1); hash = sc->data->LayerN; Index: trunk/src_plugins/io_tedax/tboard.c =================================================================== --- trunk/src_plugins/io_tedax/tboard.c (revision 22245) +++ trunk/src_plugins/io_tedax/tboard.c (revision 22246) @@ -164,8 +164,8 @@ pcb_subc_t *proto = htscp_get(&subcs, subc); subc2fpname(fpname, proto); - pcb_subc_get_host_trans(subc, &trsc); - pcb_subc_get_host_trans(proto, &trpr); + pcb_subc_get_host_trans(subc, &trsc, 0); + pcb_subc_get_host_trans(proto, &trpr, 0); pcb_fprintf(f, " place %ld %s %.06mm %.06mm %f %d comp\n", subc->ID, fpname, trsc.ox, trsc.oy, trpr.rot - trsc.rot, trpr.on_bottom != trsc.on_bottom); }