public RTLineMoveCommand(decimal dx, decimal dy, decimal dz, Vector3 compensation, RTMovementOptions opts, MachineParameters config)
 {
     this.config        = config;
     this.Delta         = new Vector3(dx, dy, dz);
     this.Compenstation = compensation;
     this.Options       = opts;
     this.DirStart      = this.DirEnd = Vector3.Normalize(this.Delta);
     FindPhysicalParameters();
     Length = PhysicalDelta.Length();
 }
 public RTLineMoveCommand(Vector3 delta, Vector3 compensation, RTMovementOptions opts, MachineParameters config)
 {
     this.config        = config;
     this.Delta         = delta;
     this.Compenstation = compensation;
     this.Options       = opts;
     this.DirStart      = this.DirEnd = Vector3.Normalize(this.Delta);
     FindPhysicalParameters();
     Length = Delta.Length();
 }
Exemplo n.º 3
0
 private void Setup(Vector3 delta, Vector3 compensation, bool ccw, AxisState.Plane plane, RTMovementOptions opts, MachineParameters config)
 {
     Plane        = plane;
     Delta        = delta;
     Compensation = compensation;
     CCW          = ccw;
     Config       = config;
     Options      = opts;
     DeltaProj    = VectorPlaneProj(Delta + Compensation, Plane);
     Height       = VectorPlaneNormalProj(Delta + Compensation, Plane);
 }
Exemplo n.º 4
0
        public RTArcMoveCommand(Vector3 delta, Vector3 compensation, decimal r, bool ccw, AxisState.Plane plane,
                                RTMovementOptions opts, MachineParameters config)
        {
            Setup(delta, compensation, ccw, plane, opts, config);

            R      = Math.Abs(r);
            bigArc = (r < 0);
            decimal d   = DeltaProj.Length();
            decimal hcl = (decimal)Math.Sqrt((double)(R * R - d * d / 4));

            if (ccw && !bigArc || !ccw && bigArc)
            {
                hcl = -hcl;
            }
            startToCenterProj = DeltaProj / 2 + Vector2.Normalize(DeltaProj.Right()) * hcl;
            endToCenterProj   = startToCenterProj - DeltaProj;

            FinalSetup();
        }
Exemplo n.º 5
0
        public RTArcMoveCommand(Vector3 delta, Vector3 compensation, Vector3 startToCenter, bool ccw, AxisState.Plane plane,
                                RTMovementOptions opts, MachineParameters config)
        {
            Setup(delta, compensation, ccw, plane, opts, config);

            startToCenterProj = VectorPlaneProj(startToCenter, Plane);
            endToCenterProj   = startToCenterProj - DeltaProj;
            decimal nd = Vector2.Cross(DeltaProj, startToCenterProj);

            if (nd > 0 && CCW || nd < 0 && !CCW)
            {
                bigArc = false;
            }
            else
            {
                bigArc = true;
            }
            R = startToCenter.Length();

            FinalSetup();
        }