diff --git a/binary-tiling.cpp b/binary-tiling.cpp index adf2463d..f37a7684 100644 --- a/binary-tiling.cpp +++ b/binary-tiling.cpp @@ -148,7 +148,7 @@ namespace binary { } transmatrix parabolic(ld u) { - u = u / log(2); + u = u * vid.binary_width / log(2); return transmatrix {{{-u*u/8+1, u/2, u*u/8}, {-u/2, 1, u/2}, {-u*u/8, u/2, u*u/8+1}}}; } diff --git a/config.cpp b/config.cpp index 7bce09db..5bd17f97 100644 --- a/config.cpp +++ b/config.cpp @@ -255,6 +255,7 @@ void initConfig() { addsaver(vid.euclid_to_sphere, "euclid to sphere projection", 1.5); addsaver(vid.twopoint_param, "twopoint parameter", 1); addsaver(vid.stretch, "stretch", 1); + addsaver(vid.binary_width, "binary-tiling-width", 1); addsaver(gp::on, "goldberg", false); addsaver(gp::param.first, "goldberg-x", gp::param.first); diff --git a/geom-exp.cpp b/geom-exp.cpp index e437c902..a20057c1 100644 --- a/geom-exp.cpp +++ b/geom-exp.cpp @@ -287,7 +287,7 @@ void showEuclideanMenu() { if(ts == 6 && tv == 3) dialog::addSelItem(XLAT("variations"), XLAT("does not matter"), 'v'); else if(binarytiling) - dialog::addSelItem(XLAT("variations"), XLAT("not implemented"), 'v'); + dialog::addSelItem(XLAT("width"), fts(vid.binary_width), 'v'); else { dialog::addBoolItem(XLAT("variations"), nonbitrunc, 'v'); dialog::lastItem().value = gp::operation_name(); @@ -392,7 +392,15 @@ void showEuclideanMenu() { else if(uni == 'u') showquotients = !showquotients; else if(uni == 'v') { - if(euclid6 || binarytiling) ; + if(euclid6) ; + else if(binarytiling) { + dialog::editNumber(vid.binary_width, 0, 2, 0.1, 1, XLAT("binary tiling width"), ""); + dialog::reaction = [] () { + resetGeometry(); + if(texture::config.tstate == texture::tsActive) + texture::config.remap(texture::tsActive, texture::tsActive); + }; + } else // if(S3 == 3) gp::configure(); /* else { diff --git a/hyper.h b/hyper.h index bd3cb484..6f044550 100644 --- a/hyper.h +++ b/hyper.h @@ -810,7 +810,7 @@ extern reaction_t help_delegate; struct videopar { ld scale, alpha, sspeed, mspeed, yshift, camera_angle; - ld ballangle, ballproj, euclid_to_sphere, twopoint_param, stretch; + ld ballangle, ballproj, euclid_to_sphere, twopoint_param, stretch, binary_width; int mobilecompasssize; int aurastr, aurasmoothen; diff --git a/textures.cpp b/textures.cpp index 60d8e4f1..0848c4f9 100644 --- a/textures.cpp +++ b/textures.cpp @@ -323,7 +323,7 @@ int goldbergcode(cell *c, const patterns::patterninfo& si) { void mapTexture(cell *c, textureinfo& mi, patterns::patterninfo &si, const transmatrix& T, int shift = 0) { mi.c = c; mi.symmetries = si.symmetries; - mi.current_type = c->type; + mi.current_type = celltriangles(c); if(gp::on) { mi.M = T; @@ -882,6 +882,7 @@ void init_textureconfig() { addsaver(vid.alpha, "projection", 1); addsaver(vid.scale, "scale", 1); addsaver(vid.stretch, "stretch", 1); + addsaver(vid.binary_width, "binary-tiling-width", 1); addsaver(config.texturename, "texture filename", ""); addsaver(config.texture_tuner, "texture tuning", ""); @@ -1504,7 +1505,7 @@ void texture_config::remap(eTextureState old_tstate, eTextureState old_tstate_ma auto& mi = texture_map_orig.at(oldid); int ncurr = isize(mi.tvertices); - int ntarget = ncurr * c->type / mi.current_type; + int ntarget = ncurr * celltriangles(c) / mi.current_type; vector new_tvertices = mi.tvertices; new_tvertices.resize(ntarget); for(int i=ncurr; i