Exemple #1
0
        private static void ProcessFile()
        {
            if (!File.Exists(_inputFile))
            {
                throw new FileNotFoundException("[ERROR] Input file not found", _inputFile);
            }
            try
            {
                BaseToSchematic converter;

                switch (Path.GetExtension(_inputFile))
                {
                case ".schematic":
                    converter = new SchematicToSchematic(_inputFile, _ignoreMinY, _ignoreMaxY, _excavate, _scale);
                    break;

                case ".png":
                    converter = new PNGToSchematic(_inputFile, _inputColorFile, _heightmap, _excavate, _color, _top);
                    break;

                case ".asc":
                    converter = new ASCToSchematic(_inputColorFile);
                    break;

                case ".binvox":
                    converter = new BinvoxToSchematic(_inputFile);
                    break;

                case ".qb":
                    converter = new QbToSchematic(_inputColorFile);
                    break;

                case ".obj":
                    converter = new ObjToSchematic(_inputFile, _gridSize, _excavate, _slow);
                    break;

                default:
                    Console.WriteLine("[ERROR] Unknown file extension !");
                    Console.ReadKey();
                    return;
                }

                Schematic schematic = converter.WriteSchematic();
                VoxWriter writer    = new VoxWriter();
                writer.WriteModel(_outputFile + ".vox", schematic, _direction);
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
                Console.ReadLine();
            }
        }
Exemple #2
0
 private static void ProcessQbFile()
 {
     try
     {
         Schematic schematic = QbToSchematic.WriteSchematic(_inputFile);
         VoxWriter writer    = new VoxWriter();
         writer.WriteModel(_outputFile + ".vox", schematic, _direction);
     }
     catch (Exception e)
     {
         Console.WriteLine(e);
         Console.ReadLine();
     }
 }