1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2024-09-18 17:59:38 +00:00

twist:: correct plevel values for all nil

This commit is contained in:
Zeno Rogue 2024-06-16 23:13:49 +02:00
parent 07fe59f3e1
commit dfd213fc73
2 changed files with 20 additions and 7 deletions

View File

@ -89,6 +89,8 @@ struct archimedean_tiling {
bool get_step_values(int& steps, int& single_step);
ld dual_tile_area();
transmatrix adjcell_matrix(heptagon *h, int d);
ld scale();
@ -1588,6 +1590,14 @@ EX int get_graphical_id(cell *c) {
return tid;
}
ld archimedean_tiling::dual_tile_area() {
// we need this only in Euclidean for now
if(get_geometry().kind != gcEuclid) throw hr_exception("dual_tile_area only implemented in Euclidean");
ld total = 0;
for(auto r: inradius) total += r;
return total * edgelength / 2;
}
bool archimedean_tiling::get_step_values(int& steps, int& single_step) {
int nom = -2;

View File

@ -733,7 +733,7 @@ void geometry_information::prepare_basics() {
#if CAP_BT
else if(bt::in()) bt::create_faces();
#endif
else if(nil) nilv::create_faces();
else if(nil && !mtwisted) nilv::create_faces();
#endif
scalefactor = crossf / hcrossf7;
@ -809,7 +809,7 @@ void geometry_information::prepare_basics() {
plevel = vid.plevel_factor * scalefactor;
single_step = 1;
if(mhybrid && !mproduct) {
if(mtwisted && ginf[hybrid::underlying].cclass != gcEuclid) {
#if CAP_ARCM
if(hybrid::underlying == gArchimedean)
arcm::current.get_step_values(psl_steps, single_step);
@ -825,11 +825,14 @@ void geometry_information::prepare_basics() {
}
DEBB(DF_GEOM | DF_POLY, ("steps = ", psl_steps, " / ", single_step));
plevel = M_PI * single_step / psl_steps;
if(hybrid::underlying == gEuclid && PURE) {
cgi.plevel = sqrt(3)/4.;
single_step = 1;
}
}
if(mtwisted && ginf[hybrid::underlying].cclass == gcEuclid) {
single_step = 1;
if(hybrid::underlying == gArchimedean) plevel = arcm::current.dual_tile_area();
if(hybrid::underlying == gEuclid && PURE) plevel = sqrt(3)/4.;
if(hybrid::underlying == gEuclidSquare && PURE) plevel = 1;
if(hybrid::underlying == gEuclidSquare && BITRUNCATED) plevel = 0.25;
if(hybrid::underlying == gEuclid && BITRUNCATED) plevel = sqrt(3)/12.;
}
set_sibling_limit();