pub struct Arc<S> {
pub center: Point<S>,
pub radii: Vector<S>,
pub start_angle: Angle<S>,
pub sweep_angle: Angle<S>,
pub x_rotation: Angle<S>,
}
Expand description
An elliptic arc curve segment.
Fields§
§center: Point<S>
§radii: Vector<S>
§start_angle: Angle<S>
§sweep_angle: Angle<S>
§x_rotation: Angle<S>
Implementations§
Source§impl<S: Scalar> Arc<S>
impl<S: Scalar> Arc<S>
pub fn cast<NewS: NumCast>(self) -> Arc<NewS>
Sourcepub fn from_svg_arc(arc: &SvgArc<S>) -> Arc<S>
pub fn from_svg_arc(arc: &SvgArc<S>) -> Arc<S>
Convert from the SVG arc notation.
Sourcepub fn to_svg_arc(&self) -> SvgArc<S>
pub fn to_svg_arc(&self) -> SvgArc<S>
Convert to the SVG arc notation.
Sourcepub fn for_each_quadratic_bezier<F>(&self, cb: &mut F)where
F: FnMut(&QuadraticBezierSegment<S>),
pub fn for_each_quadratic_bezier<F>(&self, cb: &mut F)where
F: FnMut(&QuadraticBezierSegment<S>),
Approximate the arc with a sequence of quadratic bézier curves.
Sourcepub fn for_each_quadratic_bezier_with_t<F>(&self, cb: &mut F)
pub fn for_each_quadratic_bezier_with_t<F>(&self, cb: &mut F)
Approximate the arc with a sequence of quadratic bézier curves.
Sourcepub fn for_each_cubic_bezier<F>(&self, cb: &mut F)where
F: FnMut(&CubicBezierSegment<S>),
pub fn for_each_cubic_bezier<F>(&self, cb: &mut F)where
F: FnMut(&CubicBezierSegment<S>),
Approximate the arc with a sequence of cubic bézier curves.
pub fn x(&self, t: S) -> S
pub fn y(&self, t: S) -> S
Sourcepub fn sample_tangent(&self, t: S) -> Vector<S>
pub fn sample_tangent(&self, t: S) -> Vector<S>
Sample the curve’s tangent at t (expecting t between 0 and 1).
Sourcepub fn get_angle(&self, t: S) -> Angle<S>
pub fn get_angle(&self, t: S) -> Angle<S>
Sample the curve’s angle at t (expecting t between 0 and 1).
pub fn end_angle(&self) -> Angle<S>
pub fn from(&self) -> Point<S>
pub fn to(&self) -> Point<S>
Sourcepub fn split_range(&self, t_range: Range<S>) -> Self
pub fn split_range(&self, t_range: Range<S>) -> Self
Return the sub-curve inside a given range of t.
This is equivalent splitting at the range’s end points.
Sourcepub fn before_split(&self, t: S) -> Arc<S>
pub fn before_split(&self, t: S) -> Arc<S>
Return the curve before the split point.
Sourcepub fn after_split(&self, t: S) -> Arc<S>
pub fn after_split(&self, t: S) -> Arc<S>
Return the curve after the split point.
Sourcepub fn for_each_flattened<F>(&self, tolerance: S, callback: &mut F)where
F: FnMut(&LineSegment<S>),
pub fn for_each_flattened<F>(&self, tolerance: S, callback: &mut F)where
F: FnMut(&LineSegment<S>),
Approximates the curve with sequence of line segments.
The tolerance
parameter defines the maximum distance between the curve and
its approximation.
Sourcepub fn for_each_flattened_with_t<F>(&self, tolerance: S, callback: &mut F)
pub fn for_each_flattened_with_t<F>(&self, tolerance: S, callback: &mut F)
Approximates the curve with sequence of line segments.
The tolerance
parameter defines the maximum distance between the curve and
its approximation.
The end of the t parameter range at the final segment is guaranteed to be equal to 1.0
.
Sourcefn flattening_step(&self, tolerance: S) -> S
fn flattening_step(&self, tolerance: S) -> S
Finds the interval of the beginning of the curve that can be approximated with a line segment.
Sourcepub fn flattened(&self, tolerance: S) -> Flattened<S> ⓘ
pub fn flattened(&self, tolerance: S) -> Flattened<S> ⓘ
Returns the flattened representation of the curve as an iterator, starting after the current point.
Sourcepub fn fast_bounding_box(&self) -> Box2D<S>
pub fn fast_bounding_box(&self) -> Box2D<S>
Returns a conservative rectangle that contains the curve.
Sourcepub fn bounding_box(&self) -> Box2D<S>
pub fn bounding_box(&self) -> Box2D<S>
Returns a conservative rectangle that contains the curve.