public void GenerateInternal(TilingConfig config, Polytope.Projection projection = Polytope.Projection.FaceCentered) { this.TilingConfig = config; // Create a base tile. Tile tile = CreateBaseTile(config); // Handle edge/vertex centered projections. if (projection == Polytope.Projection.VertexCentered) { Mobius mobius = config.VertexCenteredMobius(); tile.Transform(mobius); } else if (projection == Polytope.Projection.EdgeCentered) { Mobius mobius = config.EdgeMobius(); tile.Transform(mobius); } TransformAndAdd(tile); List <Tile> tiles = new List <Tile>(); tiles.Add(tile); Dictionary <Vector3D, bool> completed = new Dictionary <Vector3D, bool>(); completed[tile.Boundary.Center] = true; ReflectRecursive(tiles, completed); FillOutIsometries(tile, m_tiles, config.Geometry); FillOutIncidences(); }
public Tile[] FundamentalCell() { Tile template = TemplateTile(); Tile.ShrinkTile(ref template, 0.9); // Generate a cell tiling. TilingConfig tilingConfig = new TilingConfig(Q, P); Tiling poly = new Tiling(); poly.Generate(tilingConfig); m_tiles = poly.Tiles.ToList(); //SetupTransformCircle( tile ); // Call this before transforming. //SetupNeighborCircle( tile ); // Generate our cell. List <Tile> cellTiles = new List <Tile>(); foreach (Tile t in poly.Tiles) { Tile temp = template.Clone(); temp.Transform(t.Isometry.Inverse()); cellTiles.Add(temp); } return(cellTiles.ToArray()); }
/// <summary> /// Will clone the tile, transform it and add it to our tiling. /// </summary> private bool TransformAndAdd(Tile tile) { // Will we want to include it? if (!tile.IncludeAfterMobius(this.TilingConfig.M)) { return(false); } Tile clone = tile.Clone(); clone.Transform(this.TilingConfig.M); m_tiles.Add(clone); this.TilePositions[clone.Boundary.Center] = clone; return(true); }