Example #1
0
        public void Export_Obj_FilesExist()
        {
            var tempFile = Path.GetTempFileName();
            var tempObj  = Path.ChangeExtension(tempFile, "obj");
            var tempMtl  = Path.ChangeExtension(tempFile, "mtl");

            try
            {
                CrossThreadTestRunner.RunInSTAThrowException(() =>
                {
                    var view = new Viewport3D();
                    view.Export(tempObj);
                });

                FileAssert.Exists(tempObj);
                FileAssert.Exists(tempMtl);
            }
            finally
            {
                File.Delete(tempFile);

                if (File.Exists(tempObj))
                {
                    File.Delete(tempObj);
                }

                if (File.Exists(tempMtl))
                {
                    File.Delete(tempMtl);
                }
            }
        }
Example #2
0
 public static void Export(Viewport3D view, string fileName, Brush background = null)
 => view.Export(ValidateExportExtension(fileName), background);