Skip to main content

MotionKind

Enum MotionKind 

Source
#[non_exhaustive]
pub enum MotionKind {
Show 32 variants Probe { cycle: ProbeCycle, }, Rapid { to: Point3, }, Plunge { to: Point3, }, Cut { to: Point3, }, ArcCw { to: Point3, center: Point3, plane: ArcPlane, pitch: f64, }, ArcCcw { to: Point3, center: Point3, plane: ArcPlane, pitch: f64, }, Retract { to: Point3, }, LeadIn { to: Point3, }, LeadOut { to: Point3, }, Link { to: Point3, }, Dwell { seconds: f64, }, ToolChange { tool: ToolId, }, Cycle { at: Point3, cycle: Cycle, }, SpindleOn { rpm: f64, direction: SpindleDirection, }, SpindleOff, SpindleOrient { angle_deg: f64, }, SpindleSync { enabled: bool, }, Coolant { mode: Coolant, }, Comment { text: String, }, WorkPlane { origin: Point3, x_axis: Point3, z_axis: Point3, }, WorkPlaneOff, RotaryPosition { axes: Vec<RotaryWord>, }, TcpMode { enabled: bool, }, LatheMode { diameter_mode: bool, }, SpindleSurfaceSpeed { surface_speed: f64, max_rpm: f64, direction: SpindleDirection, }, ThreadCut { to: Point3, pitch: f64, }, TurnThreadCycle { cycle: TurnThreadCycle, }, PolarInterpolation { enabled: bool, }, CylindricalInterpolation { radius: Option<f64>, }, LinearRotary { to: Point3, axes: Vec<RotaryWord>, }, Stop { optional: bool, }, PassThrough { text: String, },
}
Expand description

One typed motion. Positions are the TOOL REFERENCE POINT in machine coordinates; every variant that moves the tool ends at to. The start of a motion is the end of the previous one.

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

Probe

An expanded probe trigger move (lane C14); never ordinary cutting.

Fields

§

Rapid

Rapid traverse clear of material.

Fields

§

Plunge

Vertical (or near-vertical) descent into material at plunge feed.

Fields

§

Cut

Cutting move.

Fields

§

ArcCw

Clockwise arc (looking down the plane’s normal) about center. pitch is the axial advance per full turn for helices, 0 for planar arcs.

Fields

§center: Point3
§plane: ArcPlane
§pitch: f64
§

ArcCcw

Counter-clockwise arc, same conventions as ArcCw.

Fields

§center: Point3
§plane: ArcPlane
§pitch: f64
§

Retract

Move up and away from material.

Fields

§

LeadIn

Approach into the cut.

Fields

§

LeadOut

Departure out of the cut.

Fields

Non-cutting connection between passes that stays near the surface.

Fields

§

Dwell

Pause for seconds.

Fields

§seconds: f64
§

ToolChange

Tool change to tool.

Fields

§tool: ToolId
§

Cycle

A canned hole cycle executed at at (XY; Z is the retract plane).

Fields

§cycle: Cycle
§

SpindleOn

Spindle on at rpm.

Fields

§rpm: f64
§

SpindleOff

§

SpindleOrient

Orient the stopped spindle to angle_deg (fine boring, back boring: M19).

Fields

§angle_deg: f64
§

SpindleSync

Rigid tapping mode on/off (spindle synchronized with the feed: M29).

Fields

§enabled: bool
§

Coolant

Coolant mode change.

Fields

§mode: Coolant
§

Comment

A comment passed to the post verbatim (operation start, notes).

Fields

§text: String
§

WorkPlane

Tilted work plane on (G68.2 / CYCLE800 / PLANE SPATIAL) for a 3+2 indexed section. origin, x_axis and z_axis are in setup coordinates; positions in the stream STAY in setup coordinates (the post derives the local coordinates); z_axis is the section’s tool axis, and canned-cycle depths inside the section run along it.

Fields

§origin: Point3
§x_axis: Point3
§z_axis: Point3
§

WorkPlaneOff

Tilted work plane off (G69 / CYCLE800() / PLANE RESET).

§

RotaryPosition

Position the rotary axes with the tool clear of the part (3+2 indexing); angles in degrees in the machine’s axis order.

Fields

§

TcpMode

Rotary tool-centre-point control on/off (G43.4 / TRAORI / M128).

Fields

§enabled: bool
§

LatheMode

Enter G18 XZ turning; internal X coordinates remain radius. Diameter mode is post conversion only.

Fields

§diameter_mode: bool
§

SpindleSurfaceSpeed

G96 constant surface speed with a G50 maximum rpm; units/min consistent with model units.

Fields

§surface_speed: f64
§max_rpm: f64
§

ThreadCut

G33/G32 synchronized constant-pitch thread cut; the start is the previous position. pitch is the authoritative synchronisation: never convert it to an ordinary feed move silently.

Fields

§pitch: f64
§

TurnThreadCycle

Canned turning thread schedule; the expanded equivalent is one ThreadCut per pass.

Fields

§

PolarInterpolation

Polar interpolation on/off (G12.1 / TRANSMIT): XY programmed as X and C (lane C11b).

Fields

§enabled: bool
§

CylindricalInterpolation

Cylindrical interpolation (G7.1 / TRACYL) on a cylinder of radius; None cancels it.

Fields

§radius: Option<f64>
§

LinearRotary

Synchronized linear and rotary feed move: the linear axes to to while the rotary axes reach axes (lane C11b).

Fields

§

Stop

Program stop (M0) or optional stop (M1) (lane C15).

Fields

§optional: bool
§

PassThrough

Explicit user text passed to the post byte for byte, in order; never interpolated or generated (lane C15).

Fields

§text: String

Implementations§

Source§

impl MotionKind

Source

pub fn end(&self) -> Option<Point3>

Destination of a motion that moves the tool.

Source

pub fn is_cutting(&self) -> bool

Motions that remove material (cuts, arcs, leads, cycles, plunges).

Source

pub fn kind_name(&self) -> &'static str

Stable lowercase name (the serde tag).

Source

pub fn is_finite(&self) -> bool

Every coordinate finite.

Trait Implementations§

Source§

impl Clone for MotionKind

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for MotionKind

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for MotionKind

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl PartialEq for MotionKind

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl Serialize for MotionKind

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for MotionKind

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.