CreateBaseTile() public static method

public static CreateBaseTile ( TilingConfig config ) : Tile
config TilingConfig
return Tile
コード例 #1
0
        private static Segment[] BaseTileSegments(int p, int q)
        {
            Tiling       tiling   = new Tiling();
            TilingConfig config   = new TilingConfig(p, q, 1);
            Tile         baseTile = Tiling.CreateBaseTile(config);

            //baseTile.Transform( Mobius.Scale( 2 ) );				// Only works in Euclidean case
            return(baseTile.Boundary.Segments.ToArray());
        }
コード例 #2
0
ファイル: H3Supp.cs プロジェクト: remuladgryta/MagicTile
        private static void GetAssociatedTiling(EHoneycomb honeycomb, out Tiling tiling, out Tile baseTile)
        {
            int p, q;

            GetPQ(honeycomb, out p, out q);
            TilingConfig tilingConfig = new TilingConfig(p, q, maxTiles: m_params.MaxTiles);

            tiling = new Tiling();
            tiling.Generate(tilingConfig);

            baseTile = Tiling.CreateBaseTile(tilingConfig);
        }
コード例 #3
0
        /// <summary>
        /// Make an edge mesh of a regular tiling.
        /// </summary>
        public static Mesh MakeEdgeMesh(int p, int q)
        {
            Mesh mesh = new Mesh();

            int maxTiles = 400;

            Tiling       tiling = new Tiling();
            TilingConfig config = new TilingConfig(p, q, maxTiles: maxTiles);

            config.Shrink = 0.6;
            tiling.GenerateInternal(config);

            TilingConfig boundaryConfig = new TilingConfig(14, 7, maxTiles: 1);

            boundaryConfig.Shrink = 1.01;
            Tile boundary = Tiling.CreateBaseTile(boundaryConfig);

            AddSymmetryTriangles(mesh, tiling, boundary.Drawn);
            //AddSymmetryTriangles( mesh, tiling, null );
            return(mesh);
        }
コード例 #4
0
        /// <summary>
        /// Make an edge mesh of a regular tiling.
        /// </summary>
        public static Mesh MakeEdgeMesh(int p, int q)
        {
            Mesh mesh = new Mesh();

            int maxTiles = 400;

            Tiling       tiling = new Tiling();
            TilingConfig config = new TilingConfig(p, q, maxTiles: maxTiles);

            config.Shrink = 0.6;
            tiling.GenerateInternal(config);

            TilingConfig boundaryConfig = new TilingConfig(14, 7, maxTiles: 1);

            boundaryConfig.Shrink = 1.01;
            Tile boundary = Tiling.CreateBaseTile(boundaryConfig);

            AddSymmetryTriangles(mesh, tiling, boundary.Drawn);
            //AddSymmetryTriangles( mesh, tiling, null );
            return(mesh);

            HashSet <Vector3D> completed = new HashSet <Vector3D>();
            int count = 0;

            foreach (Tile tile in tiling.Tiles)
            {
                MeshEdges(mesh, tile, completed, null);
                count++;
                if (count >= maxTiles)
                {
                    break;
                }
            }

            return(mesh);
        }