Skip to content
Permalink
Browse files

crystal:: added multi-dimensional geometries (referred to as crystal)…

…, available via CLI for now
  • Loading branch information...
zenorogue committed Nov 30, 2018
1 parent cd35730 commit fd3b030119f566969e4faac09e7495449f7f7366
Showing with 483 additions and 4 deletions.
  1. +6 −0 cell.cpp
  2. +1 −0 classes.cpp
  3. +1 −1 classes.h
  4. +1 −0 compileunits.h
  5. +457 −0 crystal.cpp
  6. +2 −2 geometry2.cpp
  7. +3 −1 heptagon.cpp
  8. +7 −0 hyper.h
  9. +5 −0 pattern2.cpp
@@ -1170,6 +1170,7 @@ void initcells() {

hrmap* res = callhandlers((hrmap*)nullptr, hooks_newmap);
if(res) currentmap = res;
else if(geometry == gCrystal) currentmap = crystal::new_map();
else if(archimedean) currentmap = arcm::new_map();
else if(fulltorus) currentmap = new hrmap_torus;
else if(euclid) currentmap = new hrmap_euclidean;
@@ -1333,6 +1334,8 @@ int compdist(int dx[]) {
int celldist(cell *c) {
if(fulltorus)
return torusmap()->dists[decodeId(c->master)];
if(geometry == gCrystal)
return crystal::distance(c, currentmap->gamestart());
if(euwrap)
return torusconfig::cyldist(decodeId(c->master), 0);
if(masterless)
@@ -1734,6 +1737,9 @@ int celldistance(cell *c1, cell *c2) {

if(geometry == gFieldQuotient && !GOLDBERG)
return currfp.getdist(fieldpattern::fieldval(c1), fieldpattern::fieldval(c2));

if(geometry == gCrystal)
return crystal::distance(c1, c2);

if(bounded) {

@@ -1693,6 +1693,7 @@ vector<geometryinfo> ginf = {
{"Bring's Surface", "Bring", 5, 4, qsSMALL, gcHyperbolic, 0x20200, {{6, 4}}, eVariation::bitruncated},
{"Schmutz's M(3)", "M3", 12, 3, qsSMALL, gcHyperbolic, 0x20400, {{4, 2}}, eVariation::bitruncated},
{"Schmutz's M(4)", "M4", 12, 3, qsSMALL, gcHyperbolic, 0x20600, {{4, 2}}, eVariation::bitruncated},
{"Crystal", "Crystal", 8, 4, qANYQ, gcHyperbolic, 0x28000, {{3, 2}}, eVariation::pure},
};

// remember to match the following mask when specifying codes for extra geometries: 0x78600
@@ -209,7 +209,7 @@ enum eLand { laNone, laBarrier, laCrossroads, laDesert, laIce, laCaves, laJungle
enum eGeometry {
gNormal, gEuclid, gSphere, gElliptic, gZebraQuotient, gFieldQuotient, gTorus, gOctagon, g45, g46, g47, gSmallSphere, gTinySphere, gEuclidSquare, gSmallElliptic,
gKleinQuartic, gBolza, gBolza2, gMinimal, gBinaryTiling, gArchimedean,
gMacbeath, gBring, gSchmutzM2, gSchmutzM3,
gMacbeath, gBring, gSchmutzM2, gSchmutzM3, gCrystal,
gGUARD};

enum eGeometryClass { gcHyperbolic, gcEuclid, gcSphere };
@@ -31,6 +31,7 @@
#include "heptagon.cpp"
#include "binary-tiling.cpp"
#include "archimedean.cpp"
#include "crystal.cpp"
#include "language.cpp"
#include "cell.cpp"
#include "expansion.cpp"

0 comments on commit fd3b030

Please sign in to comment.
You can’t perform that action at this time.