예제 #1
0
        protected void RetractionTest()
        {
            double f;
            double m = gen.MaximumFeedRate;

            double.TryParse(textP1.Text, NumberStyles.Float, GCode.format, out f);
            gen.Reset();
            gen.NextLayer();
            gen.Move(10, 10, m);
            gen.Print(90, 10, f);
            gen.Print(90, 90, f);
            gen.Print(10, 90, f);
            gen.Print(10, 10, f);
            gen.SetRetract(true);
            gen.Move(20, 80, m);
            gen.SetRetract(false);
            gen.Print(20, 20, f);
            gen.Print(30, 20, f);
            gen.Print(30, 80, f);
            gen.Print(40, 80, f);
            gen.SetRetract(true);
            gen.Move(50, 80, m);
            gen.SetRetract(false);
            gen.Print(50, 20, f);
            gen.Print(60, 20, f);
            gen.Print(60, 80, f);
            gen.Print(70, 80, f);
            gen.SetRetract(true);
        }
예제 #2
0
        protected void Advance1()
        {
            gen.Reset();
            double fLow, fHigh, accel;

            double.TryParse(textP1.Text, NumberStyles.Float, GCode.format, out fLow);
            double.TryParse(textP2.Text, NumberStyles.Float, GCode.format, out fHigh);
            double.TryParse(textP3.Text, NumberStyles.Float, GCode.format, out accel);
            double szEdge  = 10;
            double tAccel  = (fHigh - fLow) / accel;
            double szAccel = 2.0 * (fLow * tAccel + 0.5 * accel * tAccel * tAccel);
            double left    = 20;
            double front   = 60 + szAccel;
            double edge    = 2 * szEdge + szAccel;
            double clipW   = gen.LayerHeight * gen.WidthOverHeight * gen.ClipFactor;

            while (gen.NextLayer() < 5)
            {
                gen.Move(left, front, fHigh);
                gen.Print(left + szEdge + szAccel, front, fLow);
                gen.Print(left + szEdge + szAccel, front - szAccel, fLow);
                gen.Print(left + edge, front, fLow);
                gen.Print(left + edge, front + szEdge, fLow);
                gen.Print(left + edge, front + szEdge + szAccel, fHigh);
                gen.Print(left + edge, front + edge, fLow);
                gen.Print(left + szEdge + szAccel, front + edge, fLow);
                gen.Print(left + szEdge, front + edge, fHigh);
                gen.Print(left, front + edge, fLow);
                gen.Print(left, front + szEdge + szAccel, fLow);
                gen.Print(left, front + szEdge, fHigh);
                gen.Print(left, front + clipW, fLow);
                gen.ResetE();
            }
            gen.SetRetract(true);
        }