Ejemplo n.º 1
0
        public void WindingDirectionDoesNotMatter()
        {
            string manifoldFile     = TestUtilities.GetStlPath("20mm-box");
            string manifoldGCode    = TestUtilities.GetTempGCodePath("20mm-box");
            string nonManifoldFile  = TestUtilities.GetStlPath("20mm-box bad winding");
            string nonManifoldGCode = TestUtilities.GetTempGCodePath("20mm-box bad winding");

            {
                // load a model that is correctly manifold
                ConfigSettings config    = new ConfigSettings();
                FffProcessor   processor = new FffProcessor(config);
                processor.SetTargetFile(manifoldGCode);
                processor.LoadStlFile(manifoldFile);
                // slice and save it
                processor.DoProcessing();
                processor.Finalize();
            }

            {
                // load a model that has some faces pointing the wrong way
                ConfigSettings config    = new ConfigSettings();
                FffProcessor   processor = new FffProcessor(config);
                processor.SetTargetFile(nonManifoldGCode);
                processor.LoadStlFile(nonManifoldFile);
                // slice and save it
                processor.DoProcessing();
                processor.Finalize();
            }

            // load both gcode files and check that they are the same
            TestUtilities.CheckPolysAreSimilar(manifoldGCode, nonManifoldGCode);
        }