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); } }
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) }); }
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)); } }
public void Z(float valueInMM) { MoveInDirection(GVector3.Height(valueInMM)); }
public void Y(float valueInMM) { MoveInDirection(GVector3.Depth(valueInMM)); }
public void X(float valueInMM) { MoveInDirection(GVector3.Width(valueInMM)); }
public void GoZero() { MoveInDirection(GVector3.Zero()); }
public static string SetHome(GVector3 value) { return(string.Format("G28.1 X{0} Y{1} Z{2}", value.GetWidth(), value.GetDepth(), value.GetHeight()).Replace(',', '.')); }
public static string ControlledMove(GVector3 value) { return(string.Format("G1 X{0} Y{1} Z{2}", value.GetWidth(), value.GetDepth(), value.GetHeight()).Replace(',', '.')); }
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(',', '.')); }
public GVector3(GVector3 p) { x = p.x; y = p.y; z = p.z; }
public bool isApproximately(GVector3 d) { return(Mathf.Approximately(d.x, x) && Mathf.Approximately(d.y, y) && Mathf.Approximately(d.z, z)); }