Exemplo n.º 1
0
        public void AlwaysRetractOnIslandChange()
        {
            string meshWithIslands  = TestUtlities.GetStlPath("comb");
            string gCodeWithIslands = TestUtlities.GetTempGCodePath("comb-box");

            {
                // load a model that has 3 islands
                ConfigSettings config = new ConfigSettings();
                // make sure no retractions are going to occure that are island crossing
                config.MinimumTravelToCauseRetraction = 2000;
                fffProcessor processor = new fffProcessor(config);
                processor.SetTargetFile(gCodeWithIslands);
                processor.LoadStlFile(meshWithIslands);
                // slice and save it
                processor.DoProcessing();
                processor.finalize();

                string[] gcodeContents = TestUtlities.LoadGCodeFile(gCodeWithIslands);
                int      numLayers     = TestUtlities.CountLayers(gcodeContents);
                for (int i = 1; i < numLayers - 1; i++)
                {
                    string[] layer            = TestUtlities.GetGCodeForLayer(gcodeContents, i);
                    int      totalRetractions = TestUtlities.CountRetractions(layer);
                    Assert.IsTrue(totalRetractions == 6);
                }
            }
        }