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

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

    // Provided method
    fn approx(
        self,
        tolerance: impl Into<Tolerance>,
        core: &mut Core
    ) -> 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, core: &mut Core ) -> 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>, core: &mut Core ) -> Self::Approximation

Approximate the object

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

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl Approx for (&SurfacePath, CurveBoundary<Point<1>>)

§

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

§

type Cache = ()

source§

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

source§

impl Approx for (&Cycle, &SurfaceGeometry)

§

type Approximation = CycleApprox

§

type Cache = HalfEdgeApproxCache

source§

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

source§

impl Approx for (&Handle<Curve>, SurfacePath, &SurfaceGeometry, CurveBoundary<Point<1>>)

§

type Approximation = CurveApprox

§

type Cache = CurveApproxCache

source§

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

source§

impl Approx for (&Handle<HalfEdge>, &SurfaceGeometry)

§

type Approximation = HalfEdgeApprox

§

type Cache = HalfEdgeApproxCache

source§

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

source§

impl Approx for (GlobalPath, CurveBoundary<Point<1>>)

§

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

§

type Cache = ()

source§

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

Implementors§