Skip to main content

Paths64

Struct Paths64 

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

Owned collection of closed/open paths in integer space.

整数空间下的多条路径集合。

Implementations§

Source§

impl Paths64

Source

pub fn new(paths: impl Into<Vec<Path64>>) -> Self

New collection from any Into<Vec>. / 由 Into<Vec> 构造。

Source

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

Slice of all paths. / 全部路径切片。

Source

pub fn path(&self, index: usize) -> &Path64

Borrow one path by index. / 按下标借用路径。

Source

pub fn is_empty(&self) -> bool

True if there are zero paths. / 是否无路径。

Source

pub fn len(&self) -> usize

Path count. / 路径条数。

Source

pub fn add_path(&mut self, path: Path64)

Push one path. / 追加一条路径。

Source

pub fn add_paths(&mut self, paths: impl IntoIterator<Item = Path64>)

Extend with many paths. / 追加多条。

Source

pub fn to_vec(&self) -> Vec<Path64>

Clone all paths into a vector. / 克隆为 Vec

Source

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

Per-path translate with i64 deltas. / 逐路径平移(i64)。

Source

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

Per-path scale (f64 factors, 0 → 1). / 逐路径缩放。

Source§

impl Paths64

Source

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

Simplifies every path. / 对每条路径做简化。

Source

pub fn inflate( &self, delta: f64, join_type: JoinType, end_type: EndType, miter_limit: f64, ) -> LazyPaths64

Offsets (inflates/deflates) all paths by delta using join/end rules.

按连接/端点规则对全部路径做 delta 偏移(膨胀或收缩)。

Source

pub fn to_pathsd(&self) -> LazyPathsD

Converts all paths to PathD blobs. / 将全部路径转为双精度。

Source§

impl Paths64

Source

pub fn minkowski_sum( &self, pattern: &Path64, is_closed: bool, fillrule: ClipperFillRule, ) -> LazyPaths64

Minkowski sum against each path with fill rule. / 对多条路径做闵可夫斯基和(含填充规则)。

Source

pub fn minkowski_diff( &self, pattern: &Path64, is_closed: bool, fillrule: ClipperFillRule, ) -> LazyPaths64

Minkowski difference with fill rule. / 闵可夫斯基差(含填充规则)。

Source§

impl Paths64

Source

pub fn area(&self) -> f64

Sum of signed areas. / 各路径有向面积之和。

Trait Implementations§

Source§

impl Clone for Paths64

Source§

fn clone(&self) -> Paths64

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 Paths64

Source§

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

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

impl Default for Paths64

Source§

fn default() -> Paths64

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

impl FromIterator<Path64> for Paths64

Source§

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

Collect iterator of paths. / 从迭代器收集。

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> 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.