mirror of
https://github.com/hannobraun/Fornjot
synced 2025-05-07 03:18:30 +00:00
Document PathApproxParams
This commit is contained in:
parent
6e747acd3a
commit
4d46e39eb2
@ -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>>>,
|
||||||
|
Loading…
Reference in New Issue
Block a user