Esempio n. 1
0
        internal override LinearMoveAction MultiplyMatrix(Matrix3D rotationMatrix)
        {
            // coordinate dovrebbere essere note entrambi
            if (!X.HasValue || !Y.HasValue)
            {
                throw new Exception("LinearAction.MuliplyMatrix");
            }

            var rsltArc = new ArcMoveAction(AxisAbilited, MoveType)
            {
                ClockWise = ClockWise,
                Radius    = Radius,
                Z         = Z
            };

            var rotatedEndPnt = Geometry.GeometryHelper.MultiplyPoint(new Geometry.Point3D(X.Value, Y.Value, 0), rotationMatrix);

            var rotatedCenterArc = Geometry.GeometryHelper.MultiplyPoint(new Geometry.Point3D(Center.X, Center.Y, 0), rotationMatrix);

            rsltArc.X = rotatedEndPnt.X;
            rsltArc.Y = rotatedEndPnt.Y;

            rsltArc.Center = new Point2D(rotatedCenterArc.X, rotatedCenterArc.Y);

            return(rsltArc);
        }
Esempio n. 2
0
        public void AddArcMove(AxisAbilited axisAbilited, double?x, double?y, double?z, double radius, bool clockWise, Point2D center, double?feed = null, CncCompensationState cncCompensationState = CncCompensationState.NoChange)
        {
            var moveType = clockWise ? MoveType.Cw : MoveType.Ccw;

            var moveAction = new ArcMoveAction(axisAbilited, moveType)
            {
                Radius = radius, ClockWise = clockWise, Center = center, CncCompensationState = cncCompensationState
            };

            moveAction.Z = z;

            _x = moveAction.X = x;
            _y = moveAction.Y = y;

            this.Add(moveAction);
        }
Esempio n. 3
0
        public void AddArcMove(AxisAbilited axisAbilited, double x, double y, double?z, double radius, bool clockWise, Point2D center, Matrix3D rotationMatrix, double?feed = null, CncCompensationState cncCompensationState = CncCompensationState.NoChange)
        {
            var moveType = clockWise ? MoveType.Cw : MoveType.Ccw;

            var rotatedEndPnt = Geometry.GeometryHelper.MultiplyPoint(new Geometry.Point3D(x, y, 0), rotationMatrix);

            var rotatedCenterArc = Geometry.GeometryHelper.MultiplyPoint(new Geometry.Point3D(center.X, center.Y, 0), rotationMatrix);

            var moveAction = new ArcMoveAction(axisAbilited, moveType)
            {
                Radius = radius, ClockWise = clockWise, Center = new Point2D(rotatedCenterArc.X, rotatedCenterArc.Y), CncCompensationState = cncCompensationState
            };

            moveAction.Z = z;

            _x = moveAction.X = rotatedEndPnt.X;
            _y = moveAction.Y = rotatedEndPnt.Y;

            this.Add(moveAction);
        }