pub struct MathStroke { /* private fields */ }Expand description
Stroke geometry calculator.
Computes cap and join vertices for stroked paths. Output vertices are
pushed into a Vec<PointD> consumer.
Port of C++ agg::math_stroke<VC>.
Implementations§
Source§impl MathStroke
impl MathStroke
pub fn new() -> Self
pub fn set_line_cap(&mut self, lc: LineCap)
pub fn line_cap(&self) -> LineCap
pub fn set_line_join(&mut self, lj: LineJoin)
pub fn line_join(&self) -> LineJoin
pub fn set_inner_join(&mut self, ij: InnerJoin)
pub fn inner_join(&self) -> InnerJoin
pub fn set_width(&mut self, w: f64)
pub fn width(&self) -> f64
pub fn set_miter_limit(&mut self, ml: f64)
pub fn miter_limit(&self) -> f64
pub fn set_miter_limit_theta(&mut self, t: f64)
pub fn set_inner_miter_limit(&mut self, ml: f64)
pub fn inner_miter_limit(&self) -> f64
pub fn set_approximation_scale(&mut self, s: f64)
pub fn approximation_scale(&self) -> f64
Sourcepub fn calc_cap(
&self,
vc: &mut Vec<PointD>,
v0: &VertexDist,
v1: &VertexDist,
len: f64,
)
pub fn calc_cap( &self, vc: &mut Vec<PointD>, v0: &VertexDist, v1: &VertexDist, len: f64, )
Calculate cap vertices at a line endpoint.
Output is pushed to vc. v0 is the endpoint, v1 is the adjacent
vertex, len is the distance between them.
Sourcepub fn calc_join(
&self,
vc: &mut Vec<PointD>,
v0: &VertexDist,
v1: &VertexDist,
v2: &VertexDist,
len1: f64,
len2: f64,
)
pub fn calc_join( &self, vc: &mut Vec<PointD>, v0: &VertexDist, v1: &VertexDist, v2: &VertexDist, len1: f64, len2: f64, )
Calculate join vertices at the junction of two line segments.
v0→v1 is the first segment, v1→v2 is the second.
len1 and len2 are the segment lengths.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for MathStroke
impl RefUnwindSafe for MathStroke
impl Send for MathStroke
impl Sync for MathStroke
impl Unpin for MathStroke
impl UnwindSafe for MathStroke
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