pub trait Approx: Sized {
    type Approximation;
    type Cache: Default;

    // Required method
    fn approx_with_cache(
        self,
        tolerance: impl Into<Tolerance>,
        cache: &mut Self::Cache
    ) -> Self::Approximation;

    // Provided method
    fn approx(self, tolerance: impl Into<Tolerance>) -> Self::Approximation { ... }
}
Expand description

Approximate an object

Required Associated Types§

source

type Approximation

The approximation of the object

source

type Cache: Default

The cache used to cache approximation results

Required Methods§

source

fn approx_with_cache( self, tolerance: impl Into<Tolerance>, cache: &mut Self::Cache ) -> Self::Approximation

Approximate the object, using the provided cache

This is a lower-level method that allows some degree of control over caching. Callers might consider using Approx::approx instead.

Provided Methods§

source

fn approx(self, tolerance: impl Into<Tolerance>) -> Self::Approximation

Approximate the object

tolerance defines how far the approximation is allowed to deviate from the actual object.

Implementations on Foreign Types§

source§

impl Approx for (GlobalPath, RangeOnPath)

§

type Approximation = Vec<(Point<1>, Point<3>), Global>

§

type Cache = ()

source§

fn approx_with_cache( self, tolerance: impl Into<Tolerance>, (): &mut Self::Cache ) -> Self::Approximation

source§

impl Approx for (&Curve, RangeOnPath)

§

type Approximation = Vec<(Point<1>, Point<2>), Global>

§

type Cache = ()

source§

fn approx_with_cache( self, tolerance: impl Into<Tolerance>, (): &mut Self::Cache ) -> Self::Approximation

source§

impl Approx for (&Cycle, &Surface)

§

type Approximation = CycleApprox

§

type Cache = EdgeCache

source§

fn approx_with_cache( self, tolerance: impl Into<Tolerance>, cache: &mut Self::Cache ) -> Self::Approximation

source§

impl Approx for (&HalfEdge, &Surface)

§

type Approximation = HalfEdgeApprox

§

type Cache = EdgeCache

source§

fn approx_with_cache( self, tolerance: impl Into<Tolerance>, cache: &mut Self::Cache ) -> Self::Approximation

Implementors§