diff --git a/sky.cpp b/sky.cpp index ea7f8c50..c8be6f4a 100644 --- a/sky.cpp +++ b/sky.cpp @@ -137,20 +137,34 @@ void compute_skyvertices(const vector& sky) { for(int i=0; itype; i++) { + static const int prec = 2; + if(1) { cellwalker cw0(c, i); cellwalker cw2 = cw0; cw2--; cw2 += wstep; if(!colors.count(cw2.at)) { this_poly.clear(); - transmatrix T1 = unshift(si.T); + transmatrix T1 = Id; + transmatrix T2 = unshift(si.T); auto cw = cw0; - while(colors.count(cw.at)) { - auto& co = colors[cw.at]; - this_poly.emplace_back(T1 * skypoint, co.first); - this_poly.emplace_back(T1 * hellpoint, co.second); - T1 = T1 * currentmap->adj(cw.at, cw.spin); + auto co = at_or_null(colors, cw.at); + while(co) { + this_poly.emplace_back(T2 * T1 * skypoint, co->first); + this_poly.emplace_back(T2 * T1 * hellpoint, co->second); + auto cw1 = cw; cw += wstep; cw++; + auto co1 = at_or_null(colors, cw.at); + if(!co1) break; + transmatrix A = currentmap->adj(cw1.at, cw1.spin); + hyperpoint a = tC0(A); + for(int i=1; ifirst, co1->first, 0, i, prec)); + this_poly.emplace_back(T2 * orthogonal_move(h, -cgi.SKY), gradient(co->second, co1->second, 0, i, prec)); + } + T1 = T1 * A; + co = co1; } int k = isize(this_poly); @@ -175,21 +189,56 @@ void compute_skyvertices(const vector& sky) { } while(cw != cw0); - this_poly.clear(); + vector vertices; + vector vcolors; - transmatrix T1 = unshift(si.T); + transmatrix T1 = Id; do { - this_poly.emplace_back(T1 * skypoint, colors[cw.at].first); + vertices.push_back(tC0(T1)); + vcolors.push_back(colors[cw.at].first); T1 = T1 * currentmap->adj(cw.at, cw.spin); cw += wstep; cw++; } while(cw != cw0); + + int k = isize(vertices); - int k = isize(this_poly); - for(int j=2; j