Esempio n. 1
0
        /// <summary>
        /// Determines whether a (x,y,z) triarc with given faceSizes exists (active boundary is never greater than 63)
        /// and exports graph to grafy folder.
        /// </summary>
        /// <param name="x">First number that determines triarc.</param>
        /// <param name="y">Second number that determines triarc.</param>
        /// <param name="z">Third number that determines triarc.</param>
        /// <param name="facesSizes">Allowed sizes of faces for triarc.</param>
        /// <returns>True if such triarc exist with activ boundary of maximum length 63.</returns>
        public static bool FindAndBuildTriarc(int x, int y, int z, List <int> facesSizes, string path = "")
        {
            var triarcGraph    = new TriarcGraph(x, y, z, facesSizes);
            var solving        = new TriarcSolving(x, y, z, facesSizes.ToArray());
            var reconstruction = new TriarcReconstruction(triarcGraph, solving.SolveTriarc(), path);

            return(reconstruction.ReconstructTriarc());
        }
Esempio n. 2
0
        public static bool DoesBiarcExist(int x, int y, List <int> facesSizes, int limit)
        {
            var solving  = new RingSolving(x, y, facesSizes.ToArray(), limit);
            var solution = solving.ring;
            var graph    = new ArcGraph(RingSolving.CreateOuterBoundaryOfBiarc(x, y), "Birac" + x + "," + y, facesSizes);

            if (solution != null)
            {
                var reconstruction = new TriarcReconstruction(graph, solution);
                reconstruction.ReconstructTriarc();
                return(true);
            }
            return(false);
        }
Esempio n. 3
0
        public static bool DoesGeneralBoundaryExistAndConstruct(long boundary, List <int> facesSizes, string path = "")
        {
            var solving = new TriarcSolving(boundary.BoundaryToStandardizedForm(), facesSizes.ToArray());

            if (solving.SolveTriarc() != null)
            {
                var triarcGraph = new ArcGraph(boundary.BoundaryToStandardizedForm(), Convert.ToString(boundary, 16) + "{" + string.Join <string>(",", facesSizes.Select(i => i.ToString())) + "}", facesSizes);

                var reconstruction = new TriarcReconstruction(triarcGraph, solving.SolveTriarc(), path);

                reconstruction.ReconstructTriarc();
                return(true);
            }
            return(false);
        }