Crop

Trait Crop 

Source
pub trait Crop<const N: usize>
where Self: Sized,
{ // Required methods fn transpose_axes(self) -> Self; fn crop_x(self, x: f64, keep_smaller: bool) -> ArrayVec<Self, N>; // Provided methods fn crop(self, x_min: f64, y_min: f64, x_max: f64, y_max: f64) -> Vec<Self> { ... } fn crop_y(self, y: f64, keep_smaller: bool) -> ArrayVec<Self, N> { ... } }
Expand description

Implement cropability for a geometric type.

Required Methods§

Source

fn transpose_axes(self) -> Self

Transpose the geometry axes. This is used to provide a default implementation of crop_y using crop_x.

Source

fn crop_x(self, x: f64, keep_smaller: bool) -> ArrayVec<Self, N>

Crop the geometry to a given vertically-split, half-plane defined with a X coordinate.

Provided Methods§

Source

fn crop(self, x_min: f64, y_min: f64, x_max: f64, y_max: f64) -> Vec<Self>

Crop the geometry to a given rectangle.

Source

fn crop_y(self, y: f64, keep_smaller: bool) -> ArrayVec<Self, N>

Crop the geometry to a given horizontally-split, half-plane defined with a X coordinate.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl Crop<2> for Line

Source§

fn transpose_axes(self) -> Self

Source§

fn crop_x(self, x: f64, keep_smaller: bool) -> ArrayVec<Self, 2>

Source§

impl Crop<3> for CubicBez

Source§

fn transpose_axes(self) -> Self

Source§

fn crop_x(self, x: f64, keep_smaller: bool) -> ArrayVec<Self, 3>

Implementors§