Struct bezier_rs::ArcsOptions
source · pub struct ArcsOptions {
pub strategy: ArcStrategy,
pub error: f64,
pub max_iterations: usize,
}
Expand description
Struct to represent optional parameters that can be passed to the arcs
function.
Fields§
§strategy: ArcStrategy
Determines how the approximated arcs are computed. When maximizing the arcs, the algorithm may return incorrect arcs when the curve contains any small loops or segments that look like a very thin “U”. The enum options behave as follows:
Automatic
: Maximize arcs until an erroneous approximation is found. Compute the arcs of the rest of the curve by first splitting on extremas to ensure no more erroneous cases are encountered.FavorLargerArcs
: Maximize arcs using the original algorithm from the Approximating a Bezier curve with circular arcs section of Pomax’s bezier curve primer. Erroneous arcs are possible.FavorCorrectness
: Prioritize correctness by first spliting the curve by its extremas and determine the arc approximation of each segment instead.
The default value is Automatic
.
error: f64
The error used for approximating the arc’s fit. The default is 0.5
.
max_iterations: usize
The maximum number of segment iterations used as attempts for arc approximations. The default is 100
.
Trait Implementations§
source§impl Clone for ArcsOptions
impl Clone for ArcsOptions
source§fn clone(&self) -> ArcsOptions
fn clone(&self) -> ArcsOptions
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Default for ArcsOptions
impl Default for ArcsOptions
impl Copy for ArcsOptions
Auto Trait Implementations§
impl RefUnwindSafe for ArcsOptions
impl Send for ArcsOptions
impl Sync for ArcsOptions
impl Unpin for ArcsOptions
impl UnwindSafe for ArcsOptions
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