1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
//! Approximation of objects

mod curve;
mod cycle;
mod edge;
mod face;
mod tolerance;

pub use self::{
    cycle::CycleApprox,
    face::FaceApprox,
    tolerance::{InvalidTolerance, Tolerance},
};

/// Approximate an object
pub trait Approx {
    /// The approximation of the object
    type Approximation;

    /// Additional parameters required for the approximation
    type Params;

    /// Approximate the object
    ///
    /// `tolerance` defines how far the approximation is allowed to deviate from
    /// the actual object.
    fn approx(
        &self,
        tolerance: Tolerance,
        params: Self::Params,
    ) -> Self::Approximation;
}