1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2025-10-20 16:37:40 +00:00

arb:: utilities for making Archimedean tilings

This commit is contained in:
Zeno Rogue
2020-03-22 11:27:06 +01:00
parent 3b5e31156d
commit 32c6228319
3 changed files with 66 additions and 8 deletions

View File

@@ -42,6 +42,7 @@ struct archimedean_tiling {
void make_match(int a, int i, int b, int j);
void prepare();
void compute_sum();
void compute_geometry();
void parse();
@@ -135,11 +136,20 @@ void archimedean_tiling::make_match(int a, int i, int b, int j) {
/** mostly to protect the user from entering too large numbers */
const int MAX_EDGE_ARCM = FULL_EDGE;
void archimedean_tiling::prepare() {
void archimedean_tiling::compute_sum() {
N = isize(faces);
euclidean_angle_sum = 0;
for(int f: faces) euclidean_angle_sum += (f-2.) / f;
real_faces = 0, real_face_type = 0;
for(int i=0; i<N; i++) if(faces[i] > 2) real_faces++, real_face_type += faces[i];
real_face_type /= 2;
}
void archimedean_tiling::prepare() {
compute_sum();
for(int i: faces) if(i > MAX_EDGE_ARCM) {
errormsg = XLAT("currently no more than %1 edges", its(MAX_EDGE_ARCM));
errors++;
@@ -161,10 +171,6 @@ void archimedean_tiling::prepare() {
return;
}
real_faces = 0, real_face_type = 0;
for(int i=0; i<N; i++) if(faces[i] > 2) real_faces++, real_face_type += faces[i];
real_face_type /= 2;
if(real_faces) {
for(int i=1; i<isize(faces); i++) if(faces[i] == 2 && faces[i-1] == 2) {
errormsg = XLAT("Not implemented.");
@@ -189,7 +195,6 @@ void archimedean_tiling::prepare() {
/* build the 'adjacent' table */
N = isize(faces);
int M = 2 * N + 2;
adjacent.clear();
adjacent.resize(M);