diff --git a/goldberg.cpp b/goldberg.cpp index ad5ce5da..33591c84 100644 --- a/goldberg.cpp +++ b/goldberg.cpp @@ -654,15 +654,16 @@ EX namespace gp { return spin(M_PI - d * TAU / S7 - cgi.hexshift); }; return spin(-cgi.gpdata->alpha) * build_matrix( - tile_center(), - ddspin(i) * lxpush0(cgi.tessf), - ddspin(i+1) * lxpush0(cgi.tessf), + geom3::flipped ? C02 : tile_center(), + geom3::flipped ? ddspin(i) * xpush0(cgi.tessf) : ddspin(i) * lxpush0(cgi.tessf), + geom3::flipped ? ddspin(i+1) * xpush0(cgi.tessf) : ddspin(i+1) * lxpush0(cgi.tessf), C03 ); } EX void prepare_matrices(bool inv) { if(!(GOLDBERG_INV || inv)) return; + if(embedded_plane) geom3::light_flip(true); cgi.gpdata->corners = inverse(build_matrix( loctoh_ort(loc(0,0)), loctoh_ort(param), @@ -673,7 +674,6 @@ EX namespace gp { /* should work directly without flipping but it does not... flipping for now */ - if(embedded_plane) geom3::light_flip(true); for(int i=0; icorners, at, 6); hyperpoint hl = atz(T, cgi.gpdata->corners, at + eudir(d), 6); - cgi.gpdata->Tf[i][x&GOLDBERG_MASK][y&GOLDBERG_MASK][d] = rgpushxto0(h) * rspintox(gpushxto0(h) * hl) * spin180(); + auto& res = cgi.gpdata->Tf[i][x&GOLDBERG_MASK][y&GOLDBERG_MASK][d]; + res = rgpushxto0(h) * rspintox(gpushxto0(h) * hl) * spin180(); } } @@ -1459,5 +1460,9 @@ EX namespace gp { #endif +auto hooksw = addHook(hooks_swapdim, 100, [] { + for(auto& p: gp_adj) swapmatrix(p.second); + }); + }}