diff --git a/nonisotropic.cpp b/nonisotropic.cpp index 914431b3..0ac2562e 100644 --- a/nonisotropic.cpp +++ b/nonisotropic.cpp @@ -828,7 +828,9 @@ EX namespace nilv { virtual transmatrix relative_matrix(heptagon *h2, heptagon *h1) override { for(int a=0; amove(a)) return adjmatrix(a); - return nisot::translate(mvec_to_point(coords[h1].inverse() * coords[h2])); + auto p = coords[h1].inverse() * coords[h2]; + for(int a=0; a<3; a++) p[a] = szgmod(p[a], nilperiod[a]); + return nisot::translate(mvec_to_point(p)); } void draw() override {