From 1b11f4e5e2fcf0fc46722668809cc1ad25909395 Mon Sep 17 00:00:00 2001 From: Zeno Rogue Date: Thu, 27 Sep 2018 21:51:29 +0200 Subject: [PATCH] virtualRebase tohex works in Goldberg geometries --- geometry2.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/geometry2.cpp b/geometry2.cpp index 1de13588..a12ffb1f 100644 --- a/geometry2.cpp +++ b/geometry2.cpp @@ -289,6 +289,23 @@ void virtualRebase(cell*& base, T& at, bool tohex, const U& check) { newbase = c; } } + if(tohex && GOLDBERG) { + while(true) { + newbase = NULL; + forCellCM(c2, base) { + transmatrix V2 = calc_relative_matrix(base, c2, C0); + double newz = check(V2 * at) [2]; + if(newz < currz) { + currz = newz; + bestV = V2; + newbase = c2; + } + } + if(!newbase) break; + base = newbase; + at = bestV * at; + } + } if(newbase) { base = newbase; at = bestV * at;