Beispiel #1
0
        public void TestMethod1()
        {
            Figure figure = new Figure();

            figure.Add(new Point2(0, 0));
            figure.Add(new Point2(2000, 0));
            RDMengine engine  = new RDMengine(figure, 1, 1);
            Figure    results = engine.calculateDeformation(figure[0], figure[1], null, new Screw(new float[] { 0, (float)(-5.0 * Math.Pow(10, -8)), 0, 0, 0, 0 }, figure[0].toVector()), false);

            Assert.AreEqual(0, results[results.Count - 1].Y);
            show(results);
        }
Beispiel #2
0
        private void button1_Click(object sender, EventArgs e)
        {
            FloatInput imput    = new FloatInput((TextBoxImputable)this.textBoxTest1);
            float      strenght = imput.getValue();

            if (imput.getConvertionStatus())
            {
                Figure figure = new Figure();
                figure.Add(new Point2(0, 0));
                figure.Add(new Point2(2000, 0));
                RDMengine engine  = new RDMengine(figure, 1, 1);
                Figure    results = engine.calculateDeformation(figure[0], figure[1], null, new Screw(new float[] { 0, strenght, 0, 0, 0, 0 }, figure[0].toVector()), false);
                show(results);
            }
        }
Beispiel #3
0
        public void TestMethod2()
        {
            Figure figure = new Figure();

            figure.Add(new Point2(0, 0));
            figure.Add(new Point2(2000, 0));
            figure.Add(new Point2(2000, 2000));
            figure.Add(new Point2(0, 2000));
            RDMengine engine = new RDMengine(figure, 1, 1);
            Screw     screw  = new Screw(new float[] { 0, (float)(-5.0 * Math.Pow(10, -6)), 0, 0, 0, 0 }, new Point2(0, 1000).toVector());

            /*Assert.AreEqual(
             *   engine.getDeformationFunctionY(2000, 1000, 0, (float)(-5.0 * Math.Pow(10, -8)), true, 2).calcY(1000),
             *   engine.getDeformationFunctionY(2000, 1000, 0, (float)(-5.0 * Math.Pow(10, -8)), false, 2).calcY(1000)
             *   );*/
            Figure results1 = engine.calculateDeformation(figure[0], figure[1], screw, null, true);

            show(results1);
            screw = screw.changeApplicationPoint(figure[1].toVector());
            Figure results2 = engine.calculateDeformation(figure[0], figure[1], null, screw, true);
        }
Beispiel #4
0
        private void button2_Click(object sender, EventArgs e)
        {
            FloatInput imput    = new FloatInput((TextBoxImputable)this.textBoxTest2);
            float      strenght = imput.getValue();

            if (imput.getConvertionStatus())
            {
                Figure figure = new Figure();
                figure.Add(new Point2(0, 0));
                figure.Add(new Point2(2000, 0));
                figure.Add(new Point2(2000, 2000));
                figure.Add(new Point2(0, 2000));
                RDMengine engine = new RDMengine(figure, 1, 1);
                Screw     screw  = new Screw(new float[] { 0, strenght, 0, 0, 0, 0 }, new Point2(0, 1000).toVector());

                /*Assert.AreEqual(
                 *   engine.getDeformationFunctionY(2000, 1000, 0, (float)(-5.0 * Math.Pow(10, -8)), true, 2).calcY(1000),
                 *   engine.getDeformationFunctionY(2000, 1000, 0, (float)(-5.0 * Math.Pow(10, -8)), false, 2).calcY(1000)
                 *   );*/
                Figure results1 = engine.calculateDeformation(figure[0], figure[1], screw, null, true);
                show(results1);
            }
        }