public void CNCparser_toolpathIsEmpty_ToolPathIsNotNull()
        {
            string inputPath = "";

            ToolPath5Axis toolpath = CNCFileParser.CreatePath(inputPath);

            Assert.IsNotNull(toolpath);
        }
        public void CNCFileParser_filenameIsNull_toolpathIsZerolength()
        {
            string inputFile = null;

            ToolPath5Axis toolpath = CNCFileParser.CreatePath(inputFile);

            Assert.AreEqual(0, toolpath.Count);
        }
        public void ModelPathBuilder_PathIsGoodButIncrementIsZero_ReturnsEmptyPath()
        {
            string        inputPath = "SPLINE-CHANNEL-CONTOURPATH.NCI";
            ToolPath5Axis toolpath  = CNCFileParser.CreatePath(inputPath);

            double increment = 0;
            ConstantDistancePathBuilder mpb = new ConstantDistancePathBuilder();
            ModelPath mp = mpb.Build(toolpath, increment);
        }
        public void ModelPathBuilder_toolpathIsEmptyAndIncrementIsZero_ReturnsEmptyPath()
        {
            string        inputPath = null;
            ToolPath5Axis toolpath  = CNCFileParser.CreatePath(inputPath);

            double increment = 0;
            ConstantDistancePathBuilder mpb = new ConstantDistancePathBuilder();
            ModelPath mp = mpb.Build(toolpath, increment);
        }
        public void toolpath_const_pathisOK()
        {
            string        inputFile = "STRAIGHT-TEST-8-3-15.nc";
            ToolPath5Axis tp        = CNCFileParser.CreatePath(inputFile);

            Assert.AreEqual(1.0, tp[0].Position.X);
            Assert.AreEqual(1.0, tp[0].Position.Y);
            Assert.AreEqual(2.0, tp[0].Position.Z);
        }
        public void modelpathbuilder_buildpath_isfiveAxisTrue()
        {
            string        inputFile = "2-CELL-TEST.2.nc";
            double        increment = .01;
            ToolPath5Axis toolpath  = CNCFileParser.CreatePath(inputFile);

            ConstantDistancePathBuilder mpb = new ConstantDistancePathBuilder();
            ModelPath mp = mpb.Build(toolpath, increment);

            Assert.IsTrue(mp.IsFiveAxis);
        }
        public void ModelPathBuilder_toolpathIsNull_modelpathIsEmpty()
        {
            string        inputPath = null;
            ToolPath5Axis toolpath  = CNCFileParser.CreatePath(inputPath);

            double increment = .005;
            ConstantDistancePathBuilder mpb = new ConstantDistancePathBuilder();
            ModelPath mp = mpb.Build(toolpath, increment);

            Assert.AreEqual(0, toolpath.Count);
        }
        public void ModelPathBuilder_toolpathIsEmpty_modelPathIsNotNull()
        {
            string        inputPath = "";
            ToolPath5Axis toolpath  = CNCFileParser.CreatePath(inputPath);

            double increment = .005;
            ConstantDistancePathBuilder mpb = new ConstantDistancePathBuilder();
            ModelPath mp = mpb.Build(toolpath, increment);


            Assert.IsNotNull(mp);
        }
Exemple #9
0
        private void buttonOpenNciFile_Click(object sender, EventArgs e)
        {
            OpenFileDialog openFileDialog = new OpenFileDialog();

            openFileDialog.Filter = "nci files (*.nci)|*.nci";
            if (openFileDialog.ShowDialog() == DialogResult.OK)
            {
                nciFilename           = openFileDialog.FileName;
                labelNciFilename.Text = nciFilename;
                nciFile          = FileIO.ReadDataTextFile(nciFilename);
                toolpath         = CNCFileParser.CreatePath(nciFilename);
                textBoxNCI.Lines = nciFile.ToArray();
            }
        }
        public void ModelPathBuilder_NCIfileToolpathIsGood_ReturnsModelPath()
        {
            string        inputFile = "SPLINE-CHANNEL-CONTOURPATH.NCI";
            double        increment = .005;
            ToolPath5Axis toolpath  = CNCFileParser.CreatePath(inputFile);

            ConstantDistancePathBuilder mpb = new ConstantDistancePathBuilder();
            ModelPath mp = mpb.Build(toolpath, increment);

            Assert.AreEqual(-3.876529, mp[0].Position.X, "Xentity0");
            Assert.AreEqual(0.05, mp[0].Position.Y, "Yentity0");
            Assert.AreEqual(3.307008, mp[0].Position.Z, "Zentity0");
            Assert.AreEqual(0, mp[0].Feedrate.Value, "Fentity0");
            Assert.IsFalse(mp[0].JetOn, "Jentity0");
        }
        public void modelpathbuilder_buildpath_BoundingBoxOK()
        {
            string        inputPath = "SPLINE-CHANNEL-CONTOURPATH.NCI";
            ToolPath5Axis toolpath  = CNCFileParser.CreatePath(inputPath);

            double increment = .001;
            ConstantDistancePathBuilder mpb = new ConstantDistancePathBuilder();
            ModelPath mp = mpb.Build(toolpath, increment);

            Assert.AreEqual(-3.876529, mp.BoundingBox.Min.X, "min x");
            Assert.AreEqual(.05, mp.BoundingBox.Min.Y, "min y");
            Assert.AreEqual(0.465482, mp.BoundingBox.Min.Z, "min z;");
            Assert.AreEqual(4.621802, mp.BoundingBox.Max.X, "max x");
            Assert.AreEqual(.05, mp.BoundingBox.Max.Y, "max y");
            Assert.AreEqual(3.307008, mp.BoundingBox.Max.Z, "max z");
        }
Exemple #12
0
 void buildPathFromFile(string inputFile)
 {
     try
     {
         //inputFile = "STRAIGHT-4.NC";
         //string inputFile = "SURF-TEST-1.nc";
         ToolPath5Axis toolpath          = CNCFileParser.CreatePath(inputFile);
         ConstantDistancePathBuilder mpb = new ConstantDistancePathBuilder();
         path = mpb.Build(toolpath, meshSize);
         int pathCount = path.Count;
         label2.Text = "path count:" + pathCount.ToString();
         label4.Text = path.BoundingBox.Min.X.ToString();
         label5.Text = path.BoundingBox.Min.Y.ToString();
         label6.Text = path.BoundingBox.Min.Z.ToString();
         label7.Text = path.BoundingBox.Max.X.ToString();
         label8.Text = path.BoundingBox.Max.Y.ToString();
         label9.Text = path.BoundingBox.Max.Z.ToString();
         Refresh();
     }
     catch (Exception)
     {
         throw;
     }
 }
        public void Toolpath_defaultConstructor_pathisEmpty()
        {
            ToolPath5Axis tp = new ToolPath5Axis();

            Assert.AreEqual(0, tp.Count);
        }
        public void Toolpath_defaultConstructor_pathisNotNull()
        {
            ToolPath5Axis tp = new ToolPath5Axis();

            Assert.IsNotNull(tp);
        }