Skip to main content

PathD

Struct PathD 

Source
pub struct PathD(/* private fields */);
Expand description

Double-precision polyline / polygon (PathD).

双精度折线或闭合轮廓(PathD)。

See crate::Path64 for the parallel integer API. / 与 crate::Path64 为对偶关系。

Implementations§

Source§

impl PathD

Source

pub fn from_vec(points: Vec<PointD>) -> Self

See int64 Path64 methods (float variants). / 与 Path64 方法对偶(浮点版)。

Source

pub fn new(points: impl Into<Vec<PointD>>) -> Self

Source

pub fn as_slice(&self) -> &[PointD]

Source

pub fn as_mut_slice(&mut self) -> &mut [PointD]

Source

pub fn iter(&self) -> Iter<'_, PointD>

Source

pub fn iter_mut(&mut self) -> IterMut<'_, PointD>

Source

pub fn is_empty(&self) -> bool

Source

pub fn len(&self) -> usize

Source

pub fn get_point(&self, index: usize) -> PointD

Source

pub fn add_point(&mut self, point: PointD)

Source

pub fn translate(&self, dx: f64, dy: f64) -> Self

Source

pub fn scale(&self, sx: f64, sy: f64) -> Self

Source§

impl PathD

Source

pub fn simplify(&self, epsilon: f64, is_open_path: bool) -> LazyPathsD

Simplifies this path. / 简化路径。

Source

pub fn point_in_polygon(&self, point: PointD) -> PointInPolygonResult

Point-in-polygon test. / 点在多边形内外判定。

Source

pub fn to_path64(&self) -> LazyPaths64

Quantizes to Path64 (default precision). / 量化为 Path64(默认精度)。

Source§

impl PathD

Source

pub fn minkowski_sum( &self, pattern: &PathD, is_closed: bool, precision: i32, ) -> LazyPathsD

Minkowski sum in double space. / 双精度闵可夫斯基和。

Source

pub fn minkowski_diff( &self, pattern: &PathD, is_closed: bool, precision: i32, ) -> LazyPathsD

Minkowski difference. / 闵可夫斯基差。

Source§

impl PathD

Source

pub fn area(&self) -> f64

Signed area. / 有向面积。

Trait Implementations§

Source§

impl Clone for PathD

Source§

fn clone(&self) -> PathD

Returns a duplicate of the value. Read more
1.0.0 · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for PathD

Source§

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

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

impl Default for PathD

Source§

fn default() -> PathD

Returns the “default value” for a type. Read more
Source§

impl FromIterator<PathD> for PathsD

Source§

fn from_iter<T: IntoIterator<Item = PathD>>(iter: T) -> Self

Creates a value from an iterator. Read more
Source§

impl<'a> IntoIterator for &'a PathD

Source§

type Item = &'a PD

The type of the elements being iterated over.
Source§

type IntoIter = Iter<'a, PD>

Which kind of iterator are we turning this into?
Source§

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. Read more
Source§

impl IntoIterator for PathD

Source§

type Item = PD

The type of the elements being iterated over.
Source§

type IntoIter = IntoIter<PD>

Which kind of iterator are we turning this into?
Source§

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. Read more

Auto Trait Implementations§

§

impl Freeze for PathD

§

impl RefUnwindSafe for PathD

§

impl Send for PathD

§

impl Sync for PathD

§

impl Unpin for PathD

§

impl UnsafeUnpin for PathD

§

impl UnwindSafe for PathD

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> 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 = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.