pub struct OffsetOptions {
pub join_type: JoinType,
pub end_type: EndType,
pub miter_limit: f64,
pub arc_tolerance: f64,
pub preserve_collinear: bool,
pub limits: ComplexityLimits,
}Expand description
Options controlling an offset operation.
OffsetOptions::default() produces round joins for closed polygons. For
an open path, choose one of the non-Polygon EndType variants.
Fields§
§join_type: JoinTypeCorner style for generated outlines.
end_type: EndTypeEndpoint style; Polygon means that input paths are closed regions.
miter_limit: f64Maximum miter length divided by the absolute offset distance.
Values below 1.0 are rejected. This field only affects
JoinType::Miter.
arc_tolerance: f64Maximum deviation of a round join from its ideal circle in input units.
Zero selects a scale-relative default of abs(delta) / 500.
preserve_collinear: boolKeep collinear vertices in the returned rings instead of cleaning them.
limits: ComplexityLimitsDeterministic budget for input and generated contour complexity.
Implementations§
Source§impl OffsetOptions
impl OffsetOptions
Sourcepub const fn polygon(join_type: JoinType) -> Self
pub const fn polygon(join_type: JoinType) -> Self
Creates options for closed polygons with the selected corner style.
Sourcepub const fn polyline(join_type: JoinType, end_type: EndType) -> Self
pub const fn polyline(join_type: JoinType, end_type: EndType) -> Self
Creates options for open polylines with the selected join and cap.
Passing EndType::Polygon selects closed-polygon behavior, so open
callers should use Joined, Butt, Square, or Round.
Sourcepub const fn with_miter_limit(self, miter_limit: f64) -> Self
pub const fn with_miter_limit(self, miter_limit: f64) -> Self
Returns these options with a different miter limit.
Sourcepub const fn with_arc_tolerance(self, arc_tolerance: f64) -> Self
pub const fn with_arc_tolerance(self, arc_tolerance: f64) -> Self
Returns these options with a different round-curve tolerance.
Sourcepub const fn with_preserve_collinear(self, preserve_collinear: bool) -> Self
pub const fn with_preserve_collinear(self, preserve_collinear: bool) -> Self
Returns these options with collinear output vertices preserved.
Sourcepub const fn with_limits(self, limits: ComplexityLimits) -> Self
pub const fn with_limits(self, limits: ComplexityLimits) -> Self
Returns these options with a different deterministic work budget.
Trait Implementations§
Source§impl Clone for OffsetOptions
impl Clone for OffsetOptions
impl Copy for OffsetOptions
Source§impl Debug for OffsetOptions
impl Debug for OffsetOptions
Source§impl Default for OffsetOptions
impl Default for OffsetOptions
Source§impl<'de> Deserialize<'de> for OffsetOptions
impl<'de> Deserialize<'de> for OffsetOptions
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl PartialEq for OffsetOptions
impl PartialEq for OffsetOptions
Source§impl Serialize for OffsetOptions
impl Serialize for OffsetOptions
impl StructuralPartialEq for OffsetOptions
Auto Trait Implementations§
impl Freeze for OffsetOptions
impl RefUnwindSafe for OffsetOptions
impl Send for OffsetOptions
impl Sync for OffsetOptions
impl Unpin for OffsetOptions
impl UnsafeUnpin for OffsetOptions
impl UnwindSafe for OffsetOptions
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more