pub struct ClipperOffset { /* private fields */ }Expand description
Clipper2 path offsetter: inflate or deflate polygons/polylines (integer Path64).
Clipper2 路径偏移器:对 Path64 做膨胀或收缩。
Implementations§
Source§impl ClipperOffset
impl ClipperOffset
Sourcepub fn new(
miter_limit: f64,
arc_tolerance: f64,
preserve_collinear: bool,
reverse_solution: bool,
) -> Self
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).
创建偏移引擎(斜接上限、圆弧容差、布尔选项)。
Sourcepub fn add_path(
&mut self,
path: &Path64,
join_type: JoinType,
end_type: EndType,
)
pub fn add_path( &mut self, path: &Path64, join_type: JoinType, end_type: EndType, )
Adds one path with join and end types. / 添加单条路径及连接/端点类型。
Sourcepub fn add_paths(
&mut self,
paths: &Paths64,
join_type: JoinType,
end_type: EndType,
)
pub fn add_paths( &mut self, paths: &Paths64, join_type: JoinType, end_type: EndType, )
Adds many paths. / 添加多条路径。
Sourcepub fn execute(&mut self, delta: f64) -> LazyPaths64
pub fn execute(&mut self, delta: f64) -> LazyPaths64
Runs offset by signed delta (positive = outward for closed paths). / 按有符号 delta 执行偏移。
Sourcepub fn get_miter_limit(&self) -> f64
pub fn get_miter_limit(&self) -> f64
Miter limit. / 斜接上限。
Sourcepub fn set_miter_limit(&mut self, miter_limit: f64)
pub fn set_miter_limit(&mut self, miter_limit: f64)
Sets miter limit. / 设置斜接上限。
Sourcepub fn get_arc_tolerance(&self) -> f64
pub fn get_arc_tolerance(&self) -> f64
Arc tolerance for rounding. / 圆角弧形容差。
Sourcepub fn set_arc_tolerance(&mut self, arc_tolerance: f64)
pub fn set_arc_tolerance(&mut self, arc_tolerance: f64)
Sets arc tolerance. / 设置弧形容差。
Sourcepub fn get_preserve_collinear(&self) -> bool
pub fn get_preserve_collinear(&self) -> bool
Preserve-collinear flag. / 保留共线顶点。
Sourcepub fn set_preserve_collinear(&mut self, preserve_collinear: bool)
pub fn set_preserve_collinear(&mut self, preserve_collinear: bool)
Sets preserve-collinear. / 设置是否保留共线顶点。
Sourcepub fn get_reverse_solution(&self) -> bool
pub fn get_reverse_solution(&self) -> bool
Reverse-solution flag. / 反转解。
Sourcepub fn set_reverse_solution(&mut self, reverse_solution: bool)
pub fn set_reverse_solution(&mut self, reverse_solution: bool)
Sets reverse-solution. / 设置是否反转解方向。
Auto Trait Implementations§
impl Freeze for ClipperOffset
impl RefUnwindSafe for ClipperOffset
impl !Send for ClipperOffset
impl !Sync for ClipperOffset
impl Unpin for ClipperOffset
impl UnsafeUnpin for ClipperOffset
impl UnwindSafe for ClipperOffset
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