Skip to main content

ClipperOffset

Struct ClipperOffset 

Source
pub struct ClipperOffset { /* private fields */ }
Expand description

Clipper2 path offsetter: inflate or deflate polygons/polylines (integer Path64).

Clipper2 路径偏移器:对 Path64 做膨胀或收缩。

Implementations§

Source§

impl ClipperOffset

Source

pub fn new( miter_limit: f64, arc_tolerance: f64, preserve_collinear: bool, reverse_solution: bool, ) -> Self

Creates an offset engine (miter_limit, arc_tolerance, flags).

创建偏移引擎(斜接上限、圆弧容差、布尔选项)。

Source

pub fn add_path( &mut self, path: &Path64, join_type: JoinType, end_type: EndType, )

Adds one path with join and end types. / 添加单条路径及连接/端点类型。

Source

pub fn add_paths( &mut self, paths: &Paths64, join_type: JoinType, end_type: EndType, )

Adds many paths. / 添加多条路径。

Source

pub fn execute(&mut self, delta: f64) -> LazyPaths64

Runs offset by signed delta (positive = outward for closed paths). / 按有符号 delta 执行偏移。

Source

pub fn clear(&mut self)

Clears queued paths. / 清空已添加路径。

Source

pub fn get_miter_limit(&self) -> f64

Miter limit. / 斜接上限。

Source

pub fn set_miter_limit(&mut self, miter_limit: f64)

Sets miter limit. / 设置斜接上限。

Source

pub fn get_arc_tolerance(&self) -> f64

Arc tolerance for rounding. / 圆角弧形容差。

Source

pub fn set_arc_tolerance(&mut self, arc_tolerance: f64)

Sets arc tolerance. / 设置弧形容差。

Source

pub fn get_preserve_collinear(&self) -> bool

Preserve-collinear flag. / 保留共线顶点。

Source

pub fn set_preserve_collinear(&mut self, preserve_collinear: bool)

Sets preserve-collinear. / 设置是否保留共线顶点。

Source

pub fn get_reverse_solution(&self) -> bool

Reverse-solution flag. / 反转解。

Source

pub fn set_reverse_solution(&mut self, reverse_solution: bool)

Sets reverse-solution. / 设置是否反转解方向。

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