pub struct SmoothCorner { /* private fields */ }Expand description
任意凸角的 Sketch-like smooth corner 输入入口。
Implementations§
Source§impl SmoothCorner
impl SmoothCorner
Sourcepub fn new(origin: Point, incoming_axis: Vector, outgoing_axis: Vector) -> Self
pub fn new(origin: Point, incoming_axis: Vector, outgoing_axis: Vector) -> Self
创建一个任意凸角的 smooth corner。
incoming_axis 从角点指向上一条边,outgoing_axis 从角点指向下一条边。
Sourcepub fn with_radius(self, radius: f64) -> Self
pub fn with_radius(self, radius: f64) -> Self
设置核心圆半径。
Sourcepub fn with_smoothing(self, smoothing: f64) -> Self
pub fn with_smoothing(self, smoothing: f64) -> Self
设置 Sketch-like smoothing,生成前会 clamp 到 [0, 1]。
Sourcepub fn with_limits(self, incoming_limit: f64, outgoing_limit: f64) -> Self
pub fn with_limits(self, incoming_limit: f64, outgoing_limit: f64) -> Self
设置 incoming / outgoing 两侧可占用的最大长度。
Sourcepub fn geometry(&self) -> Result<SmoothCornerGeometry, SmoothError>
pub fn geometry(&self) -> Result<SmoothCornerGeometry, SmoothError>
解析 smooth corner 的几何参数。
Sourcepub fn to_cubics(&self) -> Result<Vec<CubicSegment>, SmoothError>
pub fn to_cubics(&self) -> Result<Vec<CubicSegment>, SmoothError>
生成最多 3 段 cubic Bezier。
半径为 0 或被限制压缩到 0 时返回空数组。
Trait Implementations§
Source§impl Clone for SmoothCorner
impl Clone for SmoothCorner
Source§fn clone(&self) -> SmoothCorner
fn clone(&self) -> SmoothCorner
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for SmoothCorner
impl Debug for SmoothCorner
Source§impl PartialEq for SmoothCorner
impl PartialEq for SmoothCorner
Source§fn eq(&self, other: &SmoothCorner) -> bool
fn eq(&self, other: &SmoothCorner) -> bool
Tests for
self and other values to be equal, and is used by ==.impl Copy for SmoothCorner
impl StructuralPartialEq for SmoothCorner
Auto Trait Implementations§
impl Freeze for SmoothCorner
impl RefUnwindSafe for SmoothCorner
impl Send for SmoothCorner
impl Sync for SmoothCorner
impl Unpin for SmoothCorner
impl UnsafeUnpin for SmoothCorner
impl UnwindSafe for SmoothCorner
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