コード例 #1
0
ファイル: GridY.cs プロジェクト: luchop55/puncher
        public override void Punch(SinglePuncher singlePuncher)
        {
            SinglePuncher _singlePuncher = singlePuncher;

            double hitsDistanceYDir = hitsDistanceY;

            Point punchPoint = new Point(0, 0);

            punchPoint.Offset(xStart, yStart);

            for (int i = 0; i < numberOfPunchesX; i++)
            {
                for (int j = 0; j < numberOfPunchesY; j++)
                {
                    //insertar aqui el metodo para posicionar ejes

                    _singlePuncher.MoveCommand(punchPoint);

                    if (j < numberOfPunchesY - 1)
                    {
                        punchPoint.Y += hitsDistanceYDir;
                    }
                }
                hitsDistanceYDir *= -1.0;
                punchPoint.X     += hitsDistanceX;
            }
        }
コード例 #2
0
        public override void Punch(SinglePuncher singlePuncher)
        {
            SinglePuncher _singlePuncher = singlePuncher;

            if (!(hitsDistance > 0))
            {
                return;
            }

            double radAngle = HelperClass.DegreeToRadian(angle);

            Point punchPoint = new Point(0, 0);

            punchPoint.Offset(xStart, yStart);

            int    numberOfPunches  = Convert.ToInt32(lineLenght / hitsDistance);
            double holeDistanceCorr = lineLenght / numberOfPunches;

            for (int i = 0; i <= numberOfPunches; i++)
            {
                //insertar aqui el metodo para posicionar ejes

                _singlePuncher.MoveCommand(punchPoint);

                punchPoint.X += holeDistanceCorr * Math.Cos(radAngle);
                punchPoint.Y += holeDistanceCorr * Math.Sin(radAngle);
            }
        }
コード例 #3
0
        public override void Punch(SinglePuncher singlePuncher)
        {
            SinglePuncher _singlePuncher = singlePuncher;

            Point punchPoint = new Point(xStart, yStart);

            //insertar aqui el metodo para posicionar ejes

            _singlePuncher.MoveCommand(punchPoint);
        }
コード例 #4
0
ファイル: RecWinF.cs プロジェクト: luchop55/puncher
        public override void Punch(SinglePuncher singlePuncher)
        {
            SinglePuncher _singlePuncher = singlePuncher;

            if (!(tool.size.Width > 0))
            {
                return;
            }

            if (!(tool.size.Height > 0))
            {
                return;
            }

            double distanceX = tool.size.Width * (1 - (overlap / 100));
            double distanceY = tool.size.Height * (1 - (overlap / 100));

            int numberOfPunchesX = Convert.ToInt32(Math.Ceiling(xLenght / distanceX));

            double xDistanceFixed = (xLenght - tool.size.Width) / Convert.ToDouble(numberOfPunchesX - 1);

            int    numberOfPunchesY = Convert.ToInt32(Math.Ceiling(yLenght / distanceY));
            double yDistanceFixed   = (yLenght - tool.size.Height) / Convert.ToDouble(numberOfPunchesY - 1);

            Point punchPoint = new Point(xStart, yStart);

            punchPoint.X += tool.size.Width / 2;
            punchPoint.Y += tool.size.Height / 2;


            for (int i = 0; i < numberOfPunchesY; i++)
            {
                for (int j = 0; j < numberOfPunchesX; j++)
                {
                    _singlePuncher.MoveCommand(punchPoint);

                    if (j == (numberOfPunchesX - 1))
                    {
                        break;
                    }

                    punchPoint.X += xDistanceFixed;
                }

                xDistanceFixed *= -1;

                punchPoint.Y += yDistanceFixed;
            }
        }
コード例 #5
0
ファイル: CurveContour.cs プロジェクト: luchop55/puncher
        public override void Punch(SinglePuncher singlePuncher)
        {
            SinglePuncher _singlePuncher = singlePuncher;

            if (!(arcRadius > 0))
            {
                return;
            }

            double trayAngle = endingAngle - startingAngle;
            double hitsAngle = distanceBetweenHits / arcRadius;

            hitsAngle = HelperClass.RadianToDegree(hitsAngle);
            int    numberOfPunches = Math.Abs(Convert.ToInt32(trayAngle / hitsAngle));
            double hitsAngleFixed  = trayAngle / Convert.ToDouble(numberOfPunches);
            double currentAngle    = startingAngle;

            double arcRadiusFixed = 0;

            //double toolDiam = Math.Sqrt(Math.Pow(tool.size.Width, 2) + Math.Pow(tool.size.Height, 2));

            double toolDiam = tool.size.Width;

            if (P == 0)
            {
                arcRadiusFixed = arcRadius;
            }
            else if (P == 1)
            {
                arcRadiusFixed = arcRadius + (toolDiam / 2);
            }
            else if (P == -1)
            {
                arcRadiusFixed = arcRadius - (toolDiam / 2);
            }

            Point punchPoint = new Point(0, 0);

            for (int i = 0; i <= numberOfPunches; i++)
            {
                punchPoint = HelperClass.GetCircularCoordinates(arcRadiusFixed, currentAngle);
                punchPoint.Offset(xStart, yStart);

                //insertar aqui el metodo para posicionar ejes
                _singlePuncher.MoveCommand(punchPoint);

                currentAngle += hitsAngleFixed;
            }
        }
コード例 #6
0
        public override void Punch(SinglePuncher singlePuncher)
        {
            SinglePuncher _singlePuncher = singlePuncher;

            Point punchPoint = new Point(0, 0);

            double angleCirc = firstPunchAngle;

            for (int i = 0; i < numberOfPunches; i++)
            {
                punchPoint = HelperClass.GetCircularCoordinates(radius, angleCirc);
                punchPoint.Offset(xStart, yStart);

                //insertar aqui el metodo para posicionar ejes

                _singlePuncher.MoveCommand(punchPoint);

                angleCirc += 360.0 / Convert.ToDouble(numberOfPunches);
            }
        }
コード例 #7
0
        public override void Punch(SinglePuncher singlePuncher)
        {
            SinglePuncher _singlePuncher = singlePuncher;

            double angleRads = HelperClass.DegreeToRadian(angle);

            Point punchPoint = new Point(0, 0);

            punchPoint.Offset(xStart, yStart);

            for (int i = 0; i < numberOfPunches; i++)
            {
                //insertar aqui el metodo para posicionar ejes

                _singlePuncher.MoveCommand(punchPoint);

                punchPoint.X += hitsDistance * Math.Cos(angleRads);
                punchPoint.Y += hitsDistance * Math.Sin(angleRads);
            }
        }
コード例 #8
0
ファイル: Arc.cs プロジェクト: luchop55/puncher
        public override void Punch(SinglePuncher singlePuncher)
        {
            SinglePuncher _singlePuncher = singlePuncher;

            double currentAngle = startingAngle;

            Point punchPoint = new Point(0, 0);

            punchPoint = HelperClass.GetCircularCoordinates(arcRadius, currentAngle);

            punchPoint.Offset(xStart, yStart);

            for (int i = 0; i < numberOfPunches; i++)
            {
                //insertar aqui el metodo para posicionar ejes

                _singlePuncher.MoveCommand(punchPoint);

                currentAngle += angleBetweenHits;
                punchPoint    = HelperClass.GetCircularCoordinates(arcRadius, currentAngle);
                punchPoint.Offset(xStart, yStart);
            }
        }