示例#1
0
        void buildParmsFromValues()
        {
            try
            {
                meshSize    = .003;
                jetDiameter = .110;
                double nominalSurfaceSpeed = 50.0;
                double depthPerPass        = .005;
                int    runs          = 10;
                int    iterations    = 1;
                int    equationIndex = 4;
                double searchRadius  = jetDiameter * .1;

                var jet         = new AbMachJet(meshSize, jetDiameter, equationIndex);
                var runInfo     = new RunInfo(runs, iterations, ModelRunType.RunAsIs);
                var removalRate = new RemovalRate(nominalSurfaceSpeed, depthPerPass);
                var depthInfo   = new DepthInfo(new Vector3(.456, .8254, 0), DepthSearchType.FindAveDepth, searchRadius);
                var op          = AbMachOperation.ROCKETCHANNEL;
                var mat         = new Material(
                    MaterialType.Metal,
                    "Aluminum",
                    thickness: .25,
                    millMachinabilityIndex: 1,
                    cutMachinabilityIndex: 1,
                    criticalAngleRadians: Math.PI * 70.0 / 180);
                parms = AbMachParamBuilder.Build(op, runInfo, removalRate, mat, jet, depthInfo, meshSize);
                AbMachParametersFile.Save(parms, "params.xml");
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
示例#2
0
        public void paramFile_openSavedFile_parmsOK()
        {
            double meshSize            = .005;
            double diameter            = .04;
            double nominalSurfaceSpeed = 40;
            double depthPerPass        = .001;
            int    runs          = 3;
            int    iterations    = 1;
            int    equationIndex = 2;

            var jet         = new AbMachJet(diameter, equationIndex);
            var runInfo     = new RunInfo(runs, iterations, ModelRunType.NewFeedrates);
            var removalRate = new RemovalRate(nominalSurfaceSpeed, depthPerPass);
            var depthInfo   = new DepthInfo(new GeometryLib.Vector3(1, 1, 0), DepthSearchType.FindAveDepth, diameter / 10);
            var op          = AbMachOperation.ROCKETCHANNEL;
            var mat         = new AWJModel.Material(AWJModel.MaterialType.Metal, "Aluminum", .25, 123, 456, 789, 143, 345, 543, 1);

            AbMachParameters parms    = AbMachParamBuilder.Build(op, runInfo, removalRate, mat, jet, depthInfo, meshSize);
            string           fileName = "paramSaveTest.prx";

            AbMachParametersFile.Save(parms, fileName);
            AbMachParameters parmsOpen = AbMachParametersFile.Open(fileName);

            Assert.AreEqual(parms.Material.CriticalRemovalAngle, parmsOpen.Material.CriticalRemovalAngle);
        }
示例#3
0
        static void Main(string[] args)
        {
            double meshSize = .002;
            int    index    = 3;
            double jetD     = .050;

            AbMachJet abmachJet = new AbMachJet(jetD, meshSize, index);

            Console.WriteLine(abmachJet.Diameter.ToString());
            Console.WriteLine(abmachJet.JetMeshRadius.ToString());
            Console.WriteLine(abmachJet.EquationIndex.ToString());
            Console.ReadLine();
            double[,] footprint = abmachJet.FootPrint();
            List <string> file = new List <string>();
            List <DrawingIO.DwgEntity> pointList = new List <DrawingIO.DwgEntity>();

            DrawingIO.DXFFile dxffile = new DrawingIO.DXFFile();


            for (int i = 0; i < footprint.GetLength(0); i++)
            {
                for (int j = 0; j < footprint.GetLength(1); j++)
                {
                    double            x  = i * meshSize;
                    double            y  = j * meshSize;
                    double            z  = footprint[i, j];
                    string            l  = x + "," + y + "," + z;
                    DrawingIO.Vector3 pt = new DrawingIO.Vector3(x, y, z);
                    pointList.Add(pt);
                    file.Add(l);
                    Console.WriteLine(l);
                    using (System.IO.StreamWriter sw = new System.IO.StreamWriter("jetfootprint.txt"))
                    {
                        foreach (string line in file)
                        {
                            sw.WriteLine(line);
                        }
                    }
                }
            }
            dxffile.Save(pointList, "jetfootprint.dxf");
            Console.ReadLine();
        }
        void initParms()
        {
            meshSize = .005;
            diameter = .04;
            double nominalSurfaceSpeed = 40;
            double depthPerPass        = .001;
            int    runs          = 1;
            int    iterations    = 1;
            int    equationIndex = 2;
            double searchRadius  = diameter * .1;
            var    jet           = new AbMachJet(diameter, equationIndex);
            var    runInfo       = new RunInfo(runs, iterations, ModelRunType.NewFeedrates);
            var    removalRate   = new RemovalRate(nominalSurfaceSpeed, depthPerPass);
            var    depthInfo     = new DepthInfo(new Vector3(1, 1, 0), DepthSearchType.FindAveDepth, searchRadius);
            var    op            = AbMachOperation.ROCKETCHANNEL;
            var    mat           = new AWJModel.Material(AWJModel.MaterialType.Metal, "Aluminum", .25, 123, 456, 789, 143, 345, 543, 1);

            parms = AbMachParamBuilder.Build(op, runInfo, removalRate,
                                             mat, jet, depthInfo, meshSize);
        }
        public void AbmachJet_ctor_returnsJet()
        {
            double    jetDiam   = .1;
            double    jetRadius = jetDiam / 2;
            AbMachJet jet       = new AbMachJet(jetDiam, 2);
            double    mrr1      = jet.RemovalRate(.01 * jetRadius);

            Assert.AreEqual(0.628959112, mrr1, .005);
            double mrr0 = jet.RemovalRate(.051 * jetRadius);

            Assert.AreEqual(0.646885911, mrr0, .005);
            double mrr3 = jet.RemovalRate(.418 * jetRadius);

            Assert.AreEqual(0.847790721, mrr3, .005);
            double mrr4 = jet.RemovalRate(.649 * jetRadius);

            Assert.AreEqual(0.525730358, mrr4, .005);
            double mrr5 = jet.RemovalRate(1.001 * jetRadius);

            Assert.AreEqual(0.0, mrr5, .001);
        }
        public void abmTests_Const_valuesAreCorrect()
        {
            double meshSize            = .005;
            double diameter            = .04;
            double nominalSurfaceSpeed = 40;
            double depthPerPass        = .001;
            int    runs          = 3;
            int    iterations    = 1;
            int    equationIndex = 2;

            var jet         = new AbMachJet(diameter, equationIndex);
            var runInfo     = new RunInfo(runs, iterations, ModelRunType.NewFeedrates);
            var removalRate = new RemovalRate(nominalSurfaceSpeed, depthPerPass);
            var depthInfo   = new DepthInfo(new GeometryLib.Vector3(1, 1, 0), DepthSearchType.FindAveDepth, diameter / 10);
            var op          = AbMachOperation.ROCKETCHANNEL;
            var mat         = new AWJModel.Material(AWJModel.MaterialType.Metal, "Aluminum", .25, 1, 1, 1, 1, 1, 1, 1);

            AbMachParameters parms = AbMachParamBuilder.Build(op, runInfo, removalRate,
                                                              mat, jet, depthInfo, meshSize);

            Assert.AreEqual(nominalSurfaceSpeed, parms.RemovalRate.SurfaceSpeed, "surfspeed");
        }
        public void AbmachJet_defConst_returnsEmptyJet()
        {
            AbMachJet jet = new AbMachJet();

            Assert.IsNotNull(jet);
        }