SLR works with Archimedean

This commit is contained in:
Zeno Rogue 2019-08-26 15:39:37 +02:00
parent 7bd80dab18
commit afa3cd599d
3 changed files with 15 additions and 6 deletions

View File

@ -942,8 +942,8 @@ void draw_shape_for_texture(floorshape* sh) {
hyperpoint v1 = hpxyz3(0.25, 0.25, 0, 0);
hyperpoint v2 = hpxyz3(0.25, -0.25, 0, 0);
// SL2 needs 42
for(int a=0; a<max(MAX_EDGE, 42); a++)
// SL2 needs 6 times more
for(int a=0; a<MAX_EDGE*6; a++)
texture_order([&] (ld x, ld y) {
hyperpoint h = center + v1 * x + v2 * y;
hyperpoint inmodel;

View File

@ -576,9 +576,17 @@ void geometry_information::prepare_basics() {
steps = 0;
single_step = 1;
if(sl2) {
single_step = S3 * S7 - 2 * S7 - 2 * S3;
steps = 2 * S7;
if(BITRUNCATED) steps *= S3;
if(hybrid::underlying == gArchimedean) {
ld s = arcm::current.euclidean_angle_sum - 2;
single_step = 2;
DEBB(DF_GEOM | DF_POLY, ("1/s = ", 1/s));
steps = 4/s + .5;
}
else {
single_step = S3 * S7 - 2 * S7 - 2 * S3;
steps = 2 * S7;
if(BITRUNCATED) steps *= S3;
}
DEBB(DF_GEOM | DF_POLY, ("steps = ", steps, " / ", single_step));
plevel = M_PI * single_step / steps;
}

View File

@ -1103,7 +1103,8 @@ EX namespace slr {
transmatrix relative_matrix(cell *c1, int i) {
if(i == c1->type-2) return zpush(-cgi.plevel) * spin(-2*cgi.plevel);
if(i == c1->type-1) return zpush(+cgi.plevel) * spin(+2*cgi.plevel);
if(PURE && !archimedean) {
if(PURE && hybrid::underlying != gArchimedean) {
/* todo: always do something like this! */
int j = c1->c.spin(i);
ld A = master_to_c7_angle();
transmatrix Q = spin(-A + 2 * M_PI * i / S7) * xpush(cgi.tessf) * spin(M_PI - 2 * M_PI * j / S7 + A);