/// <summary>
        /// コンバート
        /// </summary>
        /// <param name="parameter"></param>
        private void Convert(object parameter)
        {
            STLLoader stlModel = new STLLoader(InputFilePath);

            if (!stlModel.Load())
            {
                MessageBox.Show(
                    "STLのLoadに失敗しました。",
                    "エラー",
                    MessageBoxButton.OK,
                    MessageBoxImage.Error);
                return;
            }

            HalfEdge halfEdge = new HalfEdge();

            if (!halfEdge.Create(stlModel.Vertex))
            {
                MessageBox.Show(
                    "STLのConvertに失敗しました。",
                    "エラー",
                    MessageBoxButton.OK,
                    MessageBoxImage.Error);
                return;
            }

            halfEdge.WriteFile(OutputFilePath, SelectedVersion, DoBinary);

            MessageBox.Show(
                "STLのConvertに成功しました。",
                "成功",
                MessageBoxButton.OK,
                MessageBoxImage.Information);
        }
Пример #2
0
        static void Main(string[] args)
        {
            CommandArgs commandArgs = new CommandArgs();

            if (!commandArgs.Parse(args))
            {
                commandArgs.ShowHelp();
                return;
            }

            Console.WriteLine("Loading STL Data : " + commandArgs.inputFile);
            STLLoader stlModel = new STLLoader(commandArgs.inputFile);

            if (!stlModel.Load())
            {
                Console.WriteLine("Failed Load STL Data");
                return;
            }

            Console.WriteLine("Loaded STL Data");


            HalfEdge half = new HalfEdge();

            Console.WriteLine("Create Half Edge Data");
            if (!half.Create(stlModel.Vertex))
            {
                Console.WriteLine("Failed HalfEdge Structure");
                return;
            }
            Console.WriteLine("Created HalfEdge Data");

            Console.WriteLine("Output File : " + commandArgs.outputFile);
            half.WriteFile(commandArgs.outputFile, commandArgs.version, commandArgs.binary);
            Console.WriteLine("Success");
            return;
        }