improved correctness checking for Archimedean symbols: 6,5 or 6,4,2 are no longer valid

This commit is contained in:
Zeno Rogue 2020-09-16 20:32:26 +02:00
parent 9e06993bb4
commit 2aec7b7691
1 changed files with 14 additions and 3 deletions

View File

@ -170,13 +170,24 @@ void archimedean_tiling::prepare() {
errors++;
return;
}
if(isize(faces) < 2) {
for(int i: faces) if(i < 2) {
errormsg = XLAT("not enough edges");
errors++;
return;
}
vector<int> nondigonal;
for(int i: faces) if(i > 2) nondigonal.push_back(i);
if(isize(faces) < 2 || isize(nondigonal) == 1) {
errormsg = XLAT("not enough faces");
errors++;
return;
}
for(int i: faces) if(i < 2) {
errormsg = XLAT("not enough edges");
if(isize(nondigonal) == 2 && faces[0] != faces[1]) {
errormsg = XLAT("invalid dihedron");
errors++;
return;
}