Document PathApproxParams

This commit is contained in:
Hanno Braun 2024-07-31 19:26:25 +02:00
parent 6e747acd3a
commit 4d46e39eb2

View File

@ -59,11 +59,13 @@ pub fn approx_circle<const D: usize>(
points points
} }
/// Path approximation parameters for a circle
struct PathApproxParams { struct PathApproxParams {
increment: Scalar, increment: Scalar,
} }
impl PathApproxParams { impl PathApproxParams {
/// Compute path approximation parameters for the given circle and tolerance
pub fn for_circle<const D: usize>( pub fn for_circle<const D: usize>(
circle: &Circle<D>, circle: &Circle<D>,
tolerance: impl Into<Tolerance>, tolerance: impl Into<Tolerance>,
@ -82,10 +84,12 @@ impl PathApproxParams {
Self { increment } Self { increment }
} }
/// Return the increment
pub fn increment(&self) -> Scalar { pub fn increment(&self) -> Scalar {
self.increment self.increment
} }
/// Generate points to approximate the circle within the boundary
pub fn points( pub fn points(
&self, &self,
boundary: impl Into<CurveBoundary<Point<1>>>, boundary: impl Into<CurveBoundary<Point<1>>>,