Exemplo n.º 1
0
        private void CheckBoundaryQuality(IneqMesh ineqMesh)
        {
            if (ineqMesh == null)
            {
                return;
            }

            int c = 0;
            Dictionary <int, int> counts = new Dictionary <int, int>();

            do
            {
                c = ineqMesh.CheckBoundaryQuality(minQuality, false);

                if (!counts.Keys.Contains(c))
                {
                    counts[c] = 1;
                }
                else
                {
                    counts[c]++;
                }
            }while (c != 0 && counts[c] < 3);

            //if (c != 0)
            //{
            //    c = ineqMesh.CheckBoundaryQuality(minQuality, true);
            //}

            ineqMesh.DeleteLonelyPoints();

            ineqMesh.Jiggle(3);

            return;
        }
Exemplo n.º 2
0
        public ActionResult GetMesh(string Mesh = "")
        {
            IneqMesh ineqMesh = null;
            string   path     = null;

            MeshSamples samples = new MeshSamples();

            string FileName = Mesh + ".ply";

            path = System.IO.Path.Combine(Server.MapPath("~/Samples"), FileName);
            if (System.IO.File.Exists(path))
            {
                return(File(path, "application/octet-stream"));
            }

            ineqMesh = samples[Mesh];
            ineqMesh.Create();
            CheckQuality(ineqMesh);
            ineqMesh.DeleteLonelyPoints();

            string ply = GetPLY(ineqMesh);

            System.IO.File.WriteAllText(path, ply);
            return(File(path, "application/octet-stream"));
        }
Exemplo n.º 3
0
        public ActionResult GetCustomMeshJiggle()
        {
            IneqMeshViewModel ineqMeshViewModel = (IneqMeshViewModel)Session["IneqMeshViewModel"];
            IneqMesh          ineqMesh          = null;

            if (ineqMeshViewModel == null || ineqMeshViewModel.IneqMesh == null || ineqMeshViewModel.IneqMesh.Tetrahedrons.Count == 0)
            {
                return(Content(null));
            }

            ineqMesh = ineqMeshViewModel.IneqMesh;

            ineqMesh.Jiggle(3);

            ineqMesh.DeleteLonelyPoints();

            string ply = GetPLY(ineqMesh);

            ineqMeshViewModel.PLY = ply;
            return(Content(ply));
        }