예제 #1
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"));
        }
예제 #2
0
        public ActionResult Index(string Mesh = "")
        {
            MeshSamples samples = new MeshSamples();

            if (String.IsNullOrEmpty(Mesh))
            {
                Mesh = samples.Samples.Skip(new Random().Next(samples.Samples.Count())).First();
                //Mesh = "Ball";
            }

            ViewBag.CurrentMesh = Mesh;
            return(View(samples));
        }