Example #1
0
 //get a file name and create the needed directories
 public static String GetAndEnsureFilename(PatternItem info, String outDir, String extension, String label="")
 {
     Directory.CreateDirectory(outDir);
     String outPath = Path.Combine(outDir, info.Directory);
     String filename = Path.Combine(outPath, Util.ConvertFileName(info.Name, label, extension));
     return filename;
 }
Example #2
0
 //save a text file
 public static void SavePattern(String[] lines, PatternItem info, String outDir, String label = "")
 {
     String outPath = Path.Combine(outDir, info.Directory);
     Directory.CreateDirectory(outPath);
     File.WriteAllLines(Path.Combine(outPath, Util.ConvertFileName(info.Name, label, ".txt")), lines);
 }
Example #3
0
 //save a png image
 public static void SavePattern(Bitmap pattern, PatternItem info, String outDir, String label = "")
 {
     String outPath = Path.Combine(outDir, info.Directory);
     Directory.CreateDirectory(outPath);
     pattern.Save(Path.Combine(outPath, Util.ConvertFileName(info.Name, label, ".png")));
 }
Example #4
0
 //save a mesh
 public static void SaveMesh(SegmentMesh mesh, PatternItem info, String outDir)
 {
     String outPath = Path.Combine(outDir, info.Directory);
     Directory.CreateDirectory(outPath);
     mesh.WriteToFile(Path.Combine(outPath, Util.ConvertFileName(info.Name, "", ".txt")));
 }