Skip to main content

Cutter

Enum Cutter 

Source
pub enum Cutter {
    Flat(FlatCutter),
    Ball(BallCutter),
    Bull(BullCutter),
    Cone(ConeCutter),
    BallCone(BallConeCutter),
    Frustum(FrustumCutter),
    Lollipop(LollipopCutter),
    Dovetail(DovetailCutter),
}
Expand description

Any of the five cutters, with static dispatch over the profile trait.

Variants§

Implementations§

Source§

impl Cutter

Source

pub fn flat(diameter: f64, cutting_length: f64, shaft_length: f64) -> Self

Source

pub fn ball(diameter: f64, cutting_length: f64, shaft_length: f64) -> Self

Source

pub fn bull( diameter: f64, corner_radius: f64, cutting_length: f64, shaft_length: f64, ) -> Self

Source

pub fn cone( maximum_diameter: f64, included_angle_deg: f64, cutting_length: f64, shaft_length: f64, ) -> Self

Source

pub fn ball_cone( ball_diameter: f64, maximum_diameter: f64, included_angle_deg: f64, cutting_length: f64, shaft_length: f64, ) -> Self

Source

pub fn default_point_angle_deg(kind: ToolKind) -> Option<f64>

Default included angle of a hole-making tool kind when the geometry has none.

Source

pub fn from_tool(tool: &Tool) -> Result<Cutter, CutterError>

The validated profile of a tool, or why it has none.

Flat, tap, reamer, boring bar, thread mill, slot and T-slot cutters are cylinders (slot cutters on their arbor through shaft_diameter); a face mill is a bull when it has a corner radius; drills, spot and centre drills are cones with their point angle (118°, 90°, 60° unless given); V-bits and engravers are cones; a chamfer or tapered flat mill with a tip diameter is a frustum, without one a cone; a tapered ball is a ball-cone; a lollipop and a dovetail need shaft_diameter as their neck. Lathe inserts have no milling profile.

Source

pub fn frustum( tip_diameter: f64, diameter: f64, included_angle_deg: f64, cutting_length: f64, shaft_length: f64, ) -> Self

Source

pub fn lollipop( ball_diameter: f64, neck_diameter: f64, cutting_length: f64, shaft_length: f64, ) -> Self

Source

pub fn dovetail( diameter: f64, neck_diameter: f64, included_angle_deg: f64, cutting_length: f64, shaft_length: f64, ) -> Self

Trait Implementations§

Source§

impl Clone for Cutter

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 Copy for Cutter

Source§

impl CutterProfile for Cutter

Source§

fn kind(&self) -> CutterKind

Source§

fn radius(&self) -> f64

Maximum cutting radius.
Source§

fn cutting_length(&self) -> f64

Usable cutting height above the reference point.
Source§

fn shaft_length(&self) -> f64

Shank length above the cutting length, for collision checks and preview.
Source§

fn shaft_radius(&self) -> f64

Shank radius; equals the cutting radius unless the tool says otherwise.
Source§

fn profile_height(&self) -> f64

Height at which the curved/sloped profile ends and the cylindrical part begins.
Source§

fn height_at_radius(&self, r: f64) -> Option<f64>

Profile height above the reference at radial distance r; None outside [0, radius].
Source§

fn radius_at_height(&self, h: f64) -> Option<f64>

Largest cutting radius at local height h; None outside [0, cutting_length].
Source§

fn max_radius_at_height(&self, h: f64) -> Option<f64>

radius_at_height extended by the shank up to cutting_length + shaft_length.
Source§

fn segments(&self) -> Vec<ProfileSegment>

The piecewise description, bottom segment first.
Source§

fn validate(&self) -> Result<(), CutterError>

User-facing dimension check.
Source§

fn diameter(&self) -> f64

Source§

fn total_height(&self) -> f64

Total modelled height: cutting length plus shank.
Source§

impl Debug for Cutter

Source§

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

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

impl<'de> Deserialize<'de> for Cutter

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 Cutter

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 Cutter

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 Cutter

Auto Trait Implementations§

§

impl Forget for Cutter

§

impl Freeze for Cutter

§

impl Move for Cutter

§

impl RefUnwindSafe for Cutter

§

impl Send for Cutter

§

impl Sync for Cutter

§

impl Unpin for Cutter

§

impl UnsafeUnpin for Cutter

§

impl UnwindSafe for Cutter

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.