Ejemplo n.º 1
0
        public static void WriteDebugMesh(IMesh mesh, string sPath)
        {
            WriteOptions options = WriteOptions.Defaults;

            options.bWriteGroups = true;
            StandardMeshWriter.WriteFile(sPath, new List <WriteMesh>()
            {
                new WriteMesh(mesh)
            }, options);
        }
Ejemplo n.º 2
0
        public static void WriteDebugMesh(IMesh mesh, string sPath = @"..\..\test_output\debug.obj")
        {
            WriteOptions options = WriteOptions.Defaults;

            options.bWriteGroups      = true;
            options.bPerVertexColors  = true;
            options.bPerVertexNormals = true;
            options.bPerVertexUVs     = true;
            StandardMeshWriter.WriteFile(sPath, new List <WriteMesh>()
            {
                new WriteMesh(mesh)
            }, options);
        }
Ejemplo n.º 3
0
        public static void WriteDebugMeshAndMarkers(IMesh mesh, List <Vector3d> Markers, string sPath = @"..\..\test_output\debug.obj")
        {
            WriteOptions options = WriteOptions.Defaults;

            options.bWriteGroups = true;
            List <WriteMesh> meshes = new List <WriteMesh>()
            {
                new WriteMesh(mesh)
            };
            double size = BoundsUtil.Bounds(mesh).Diagonal.Length * 0.01f;

            foreach (Vector3d v in Markers)
            {
                TrivialBox3Generator boxgen = new TrivialBox3Generator();
                boxgen.Box = new Box3d(v, size * Vector3d.One);
                boxgen.Generate();
                DMesh3 m = new DMesh3();
                boxgen.MakeMesh(m);
                meshes.Add(new WriteMesh(m));
            }

            StandardMeshWriter.WriteFile(sPath, meshes, options);
        }