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
impl PathD
Sourcepub fn from_vec(points: Vec<PointD>) -> Self
pub fn from_vec(points: Vec<PointD>) -> Self
See int64 Path64 methods (float variants). / 与 Path64 方法对偶(浮点版)。
pub fn new(points: impl Into<Vec<PointD>>) -> Self
pub fn as_slice(&self) -> &[PointD] ⓘ
pub fn as_mut_slice(&mut self) -> &mut [PointD] ⓘ
pub fn iter(&self) -> Iter<'_, PointD>
pub fn iter_mut(&mut self) -> IterMut<'_, PointD>
pub fn is_empty(&self) -> bool
pub fn len(&self) -> usize
pub fn get_point(&self, index: usize) -> PointD
pub fn add_point(&mut self, point: PointD)
pub fn translate(&self, dx: f64, dy: f64) -> Self
pub fn scale(&self, sx: f64, sy: f64) -> Self
Source§impl PathD
impl PathD
Sourcepub fn simplify(&self, epsilon: f64, is_open_path: bool) -> LazyPathsD
pub fn simplify(&self, epsilon: f64, is_open_path: bool) -> LazyPathsD
Simplifies this path. / 简化路径。
Sourcepub fn point_in_polygon(&self, point: PointD) -> PointInPolygonResult
pub fn point_in_polygon(&self, point: PointD) -> PointInPolygonResult
Point-in-polygon test. / 点在多边形内外判定。
Sourcepub fn to_path64(&self) -> LazyPaths64
pub fn to_path64(&self) -> LazyPaths64
Quantizes to Path64 (default precision). / 量化为 Path64(默认精度)。
Source§impl PathD
impl PathD
Sourcepub fn minkowski_sum(
&self,
pattern: &PathD,
is_closed: bool,
precision: i32,
) -> LazyPathsD
pub fn minkowski_sum( &self, pattern: &PathD, is_closed: bool, precision: i32, ) -> LazyPathsD
Minkowski sum in double space. / 双精度闵可夫斯基和。
Sourcepub fn minkowski_diff(
&self,
pattern: &PathD,
is_closed: bool,
precision: i32,
) -> LazyPathsD
pub fn minkowski_diff( &self, pattern: &PathD, is_closed: bool, precision: i32, ) -> LazyPathsD
Minkowski difference. / 闵可夫斯基差。
Trait Implementations§
Source§impl FromIterator<PathD> for PathsD
impl FromIterator<PathD> for PathsD
Source§impl<'a> IntoIterator for &'a PathD
impl<'a> IntoIterator for &'a PathD
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> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more