예제 #1
0
 public static string [] ControlledMove(MoveReference reference, GVector3 value)
 {
     return(new string[] {
         reference == MoveReference.Absolute? AsAbsolute(): AsRelative(),
         GCode3018Pro.ControlledMove(value)
     });
 }
    // ------------------------------------------------------------
    // fonctions de modification-----------------------------------------
    // ------------------------------------------------------------

    /// deplacer tous les points de cette quantite
    public void translateAllPoints(float movementX, float movementY, float movementZ = 0.0f)
    {
        for (int i = 0; i < mPoints.Count; ++i)
        {
            mPoints[i] += new GVector3(movementX, movementY, movementZ);
        }
    }
예제 #3
0
 public static string[] ControlledMove(MoveReference reference, GVector3 value, float feedrate, float extraction)
 {
     return(new string[] {
         reference == MoveReference.Absolute? AsAbsolute(): AsRelative(),
         GCode3018Pro.ControlledMove(value, feedrate, extraction)
     });
 }
예제 #4
0
    private void MoveInDirection(GVector3 direction)
    {
        if (m_moveReference == MoveReference.Relative)
        {
            SendCommandIfConnection(GCode3018Pro.AsRelative());
        }
        else
        {
            SendCommandIfConnection(GCode3018Pro.AsAbsolute());
        }

        if (!m_isMotorTheoriclyOn)
        {
            SendCommandIfConnection(GCode3018Pro.FastMove(direction));
        }
        else
        {
            SendCommandIfConnection(GCode3018Pro.ControlledMove(direction, m_speedRateInMm));
        }
    }
예제 #5
0
 public void Z(float valueInMM)
 {
     MoveInDirection(GVector3.Height(valueInMM));
 }
예제 #6
0
 public void Y(float valueInMM)
 {
     MoveInDirection(GVector3.Depth(valueInMM));
 }
예제 #7
0
 public void X(float valueInMM)
 {
     MoveInDirection(GVector3.Width(valueInMM));
 }
예제 #8
0
 public void GoZero()
 {
     MoveInDirection(GVector3.Zero());
 }
예제 #9
0
 public static string SetHome(GVector3 value)
 {
     return(string.Format("G28.1 X{0} Y{1} Z{2}", value.GetWidth(), value.GetDepth(), value.GetHeight()).Replace(',', '.'));
 }
예제 #10
0
 public static string ControlledMove(GVector3 value)
 {
     return(string.Format("G1 X{0} Y{1} Z{2}",
                          value.GetWidth(), value.GetDepth(), value.GetHeight()).Replace(',', '.'));
 }
예제 #11
0
 public static string ControlledMove(GVector3 value, float feedrate, float extraction)
 {
     return(string.Format("G1 X{0} Y{1} Z{2} F{3} E{4}",
                          value.GetWidth(), value.GetDepth(), value.GetHeight(), feedrate, extraction).Replace(',', '.'));
 }
예제 #12
0
 public GVector3(GVector3 p)
 {
     x = p.x;
     y = p.y;
     z = p.z;
 }
예제 #13
0
 public bool isApproximately(GVector3 d)
 {
     return(Mathf.Approximately(d.x, x) && Mathf.Approximately(d.y, y) && Mathf.Approximately(d.z, z));
 }