3.5.0-rc1
Loading...
Searching...
No Matches
tigl::CFunctionToBspline Class Reference

The FunctionToBspline class can be used to approximate an arbitrary 3D function with a B-Spline. More...

#include <CFunctionToBspline.h>

Public Member Functions

double ApproxError ()
 returns the error made by spline approximation
 CFunctionToBspline (MathFunc3d &f, double umin, double umax, int degree, double tolerance=1e-5, int maxDepth=22)
 CFunctionToBspline - Constructor.
 Handle (Geom_BSplineCurve) Curve()
 Computes the B-Spline approximation.
 ~CFunctionToBspline ()

Private Attributes

CFunctionToBsplineImpl * pimpl

Detailed Description

The FunctionToBspline class can be used to approximate an arbitrary 3D function with a B-Spline.

The function to approximate is given by 3 separate functions, one for the x values, one for y-values and one for the z-values.

Constructor & Destructor Documentation

◆ CFunctionToBspline()

tigl::CFunctionToBspline::CFunctionToBspline ( MathFunc3d & f,
double umin,
double umax,
int degree,
double tolerance = 1e-5,
int maxDepth = 22 )

CFunctionToBspline - Constructor.

Parameters
fFunction returning the values of the curve
uminStart parameter of the function to approximate
umaxEnd parameter of the function to approximate
degreeDegree of the resulting B-Spline
toleranceMaximum approximation error
maxDepthMaximum depth of curve splitting -> Influences resulting segment number. Functions with a locally unbounded derivative/curvature (e.g. a sqrt(x)-like term at an endpoint) converge slowly under the adaptive bisection used here, so this needs to be reasonably large (empirically verified: 22 reliably converges such cases to a tolerance of 1e-5, vs. 10 silently giving up early) - raising it is a no-op in cost/size for functions that already converge well before that depth.

◆ ~CFunctionToBspline()

tigl::CFunctionToBspline::~CFunctionToBspline ( )

Member Function Documentation

◆ ApproxError()

double tigl::CFunctionToBspline::ApproxError ( )

returns the error made by spline approximation

◆ Handle()

tigl::CFunctionToBspline::Handle ( Geom_BSplineCurve )

Computes the B-Spline approximation.

Field Documentation

◆ pimpl

CFunctionToBsplineImpl* tigl::CFunctionToBspline::pimpl
private

The documentation for this class was generated from the following file: