static Int16Triple RunSMC(BitMap3d bmp, string type) { watch.Reset(); watch.Start(); SMCProcessor mc = new SMCProcessor(bmp); Mesh mesh = mc.GenerateSurface(); watch.Stop(); Console.WriteLine("SMC Run time : " + watch.ElapsedMilliseconds + "ms," + "v: " + mesh.GetVertexCount() + " f:" + mesh.GetFaceCount()); if (output) { PlyManager.Output(mesh, type + "_" + mesh.GetVertexCount() + "_" + mesh.GetFaceCount() + ".ply"); } return(new Int16Triple(mesh.GetVertexCount(), mesh.GetFaceCount(), 0)); }
private static void TestSMC() { TestParms parm = TestParms.CreateParmsForEngine(); BitMap3d bmp = new BitMap3d(parm.image.data, parm.image.width, parm.image.height, parm.image.depth); for (int i = 0; i < bmp.data.Length; i++) { if (bmp.data[i] >= parm.min && bmp.data[i] <= parm.max) { bmp.data[i] = BitMap3d.WHITE; } else { bmp.data[i] = BitMap3d.BLACK; } } SMCProcessor smc = new SMCProcessor(bmp); Mesh m = smc.GenerateSurface(); PlyManager.Output(m, @"D:\VTKproj\engine.ply"); }