3.4.0
tigl::CTiglBSplineAlgorithms Class Reference

#include <CTiglBSplineAlgorithms.h>

Data Structures

struct  SurfaceKinks
 

Static Public Member Functions

static TIGL_EXPORT math_Matrix bsplineBasisMat (int degree, const TColStd_Array1OfReal &flatKnots, const TColStd_Array1OfReal &params, unsigned int derivOrder=0)
 Computes a full blown bspline basis matrix of size (params.Length(), flatKnots.Length() + degree + 1) More...
 
static TIGL_EXPORT std::vector< double > computeParamsBSplineCurve (const Handle(TColgp_HArray1OfPnt)&points, double alpha=0.5)
 computeParamsBSplineCurve: Computes the parameters of a Geom_BSplineCurve at the given points More...
 
static TIGL_EXPORT std::vector< double > computeParamsBSplineCurve (const Handle(TColgp_HArray1OfPnt)&points, double umin, double umax, double alpha=0.5)
 computeParamsBSplineCurve: Computes the parameters of a Geom_BSplineCurve at the given points More...
 
static TIGL_EXPORT std::pair< std::vector< double >, std::vector< double > > computeParamsBSplineSurf (const TColgp_Array2OfPnt &points, double alpha=0.5)
 computeParamsBSplineSurf: Computes the parameters of a Geom_BSplineSurface at the given points More...
 
static TIGL_EXPORT std::vector< Handle(Geom_BSplineCurve)> createCommonKnotsVectorCurve (const std::vector< Handle(Geom_BSplineCurve)> &splines_vector, double tol)
 createCommonKnotsVectorCurve: Creates a common knots vector of the given vector of B-splines The common knot vector contains all knots of all splines with the highest multiplicity of all splines. More...
 
static TIGL_EXPORT std::vector< Handle(Geom_BSplineSurface) > createCommonKnotsVectorSurface (const std::vector< Handle(Geom_BSplineSurface)> &old_surfaces_vector, SurfaceDirection dir)
 createCommonKnotsVectorSurface: Creates a common knot vector in both u- and / or v-direction of the given vector of B-spline surfaces The common knot vector contains all knots in u- and v-direction of all surfaces with the highest multiplicity of all surfaces. More...
 
static TIGL_EXPORT std::vector< double > getKinkParameters (const Handle(Geom_BSplineCurve)&curve)
 
static TIGL_EXPORT SurfaceKinks getKinkParameters (const Handle(Geom_BSplineSurface)&surface)
 
static TIGL_EXPORT Handle (Geom_BSplineCurve) reparameterizePiecewiseLinear(Handle(Geom_BSplineCurve) curve
 reparameterizePiecewiseLinear: Apply reparameterization on a given B-Spline curve defined by old and new parameters Based on algorithm found in The NURBS book (2nd edition), p. 251, and the explanations Here, we use a piecewise linear reparameterization function (degree q=1) interpolating the wanted parameters As a result, the degree stays the same after reparameterization More...
 
static TIGL_EXPORT Handle (Geom_BSplineSurface) flipSurface(const Handle(Geom_BSplineSurface) surface)
 flipSurface: swaps axes of the given surface, i.e., surface(u-coord, v-coord) becomes surface(v-coord, u-coord) More...
 
static TIGL_EXPORT Handle (Geom_BSplineSurface) pointsToSurface(const TColgp_Array2OfPnt &points
 pointsToSurface: interpolates a matrix of points by a B-spline surface with parameters in u- and in v-direction where the points shall be at ! Uses a skinned surface ! More...
 
static TIGL_EXPORT Handle (Geom_BSplineSurface) trimSurface(const Handle(Geom_Surface) &surface
 Trims a bspline surface. More...
 
static TIGL_EXPORT Handle (Geom_BSplineCurve) trimCurve(const Handle(Geom_BSplineCurve) &curve
 Trims a bspline curve. More...
 
static TIGL_EXPORT Handle (Geom_BSplineSurface) makeKnotsUniform(Handle(Geom_BSplineSurface) surf
 Concatenates a list of bspline curves. More...
 
static TIGL_EXPORT std::vector< std::pair< double, double > > intersections (const Handle(Geom_BSplineCurve) spline1, const Handle(Geom_BSplineCurve) spline2, double tolerance=3e-4)
 intersections: Returns all intersections of two B-splines More...
 
static TIGL_EXPORT bool isUDirClosed (const TColgp_Array2OfPnt &points, double tolerance)
 Checks, whether the point matrix points is closed in u direction. More...
 
static TIGL_EXPORT bool isVDirClosed (const TColgp_Array2OfPnt &points, double tolerance)
 Checks, whether the point matrix points is closed in u direction. More...
 
static TIGL_EXPORT std::vector< double > knotsFromCurveParameters (std::vector< double > &params, unsigned int degree, bool closedCurve)
 
static TIGL_EXPORT void matchDegree (const std::vector< Handle(Geom_BSplineCurve) > &bsplines)
 Matches the degree of all b-splines by raising the degree to the maximum degree. More...
 
static TIGL_EXPORT void matchParameterRange (const std::vector< Handle(Geom_BSplineCurve) > &bsplines, double tolerance=1e-15)
 Matches the parameter range of all b-splines to the parameter range of the first b-spline. More...
 
static TIGL_EXPORT void reparametrizeBSpline (Geom_BSplineCurve &spline, double umin, double umax, double tol=1e-15)
 
static TIGL_EXPORT void reparametrizeBSpline (Geom_BSplineSurface &spline, double umin, double umax, double vmin, double vmax, double tol)
 
static TIGL_EXPORT CTiglApproxResult reparametrizeBSplineContinuouslyApprox (const Handle(Geom_BSplineCurve) spline, const std::vector< double > &old_parameters, const std::vector< double > &new_parameters, size_t n_control_pnts)
 reparametrizeBSplineContinuouslyApprox: Reparametrizes a given B-spline by giving an array of its old parameters that should have the values of the given array of new parameters after this function call. The B-spline geometry remains approximately the same, and: After this reparametrization the spline is continuously differentiable considering its parametrization More...
 
static TIGL_EXPORT CTiglApproxResult reparametrizeBSplineNiceKnots (Handle(Geom_BSplineCurve) spline)
 
static TIGL_EXPORT double scale (const std::vector< Handle(Geom_BSplineCurve)> &splines_vector)
 scale: Returns the approximate scale of the biggest given B-spline curve More...
 
static TIGL_EXPORT double scale (const Handle(Geom_BSplineCurve)&spline)
 scale: Returns the approximate scale of the B-spline curve More...
 
static TIGL_EXPORT double scale (const TColgp_Array2OfPnt &points)
 Returns the scale of the point matrix. More...
 
static TIGL_EXPORT double scale (const TColgp_Array1OfPnt &points)
 Returns the scale of the point list by searching for the largest distance between two points. More...
 

Data Fields

static TIGL_EXPORT unsigned int nseg_u
 
static TIGL_EXPORT unsigned int unsigned int nseg_v
 
static TIGL_EXPORT std::vector< double > const std::vector< double > const & paramsNew
 
static TIGL_EXPORT std::vector< double > const & paramsOld
 
static TIGL_EXPORT Handle(Geom_BSplineCurve) concatCurves(std static TIGL_EXPORT double space_tol =1e-5)
 
static TIGL_EXPORT std::vector< double > const std::vector< double > const double tolerance
 
static TIGL_EXPORT const std::vector< double > const std::vector< double > bool uContinuousIfClosed
 
static TIGL_EXPORT double double umax
 
static TIGL_EXPORT double umin
 
static TIGL_EXPORT const std::vector< double > & uParams
 
static TIGL_EXPORT const std::vector< double > const std::vector< double > bool bool vContinuousIfClosed
 
static TIGL_EXPORT double double double double vmax
 
static TIGL_EXPORT double double double vmin
 
static TIGL_EXPORT const std::vector< double > const std::vector< double > & vParams
 

Static Public Attributes

static TIGL_EXPORT const double REL_TOL_CLOSED
 Tolerance for closed curve detection. More...
 

Member Function Documentation

◆ bsplineBasisMat()

static TIGL_EXPORT math_Matrix tigl::CTiglBSplineAlgorithms::bsplineBasisMat ( int  degree,
const TColStd_Array1OfReal &  flatKnots,
const TColStd_Array1OfReal &  params,
unsigned int  derivOrder = 0 
)
static

Computes a full blown bspline basis matrix of size (params.Length(), flatKnots.Length() + degree + 1)

Parameters
degreeDegree of the bspline
flatKnotsFlatted know vector
paramsParameters of B-Spline evaluation
Returns
The B-spline matrix

◆ computeParamsBSplineCurve() [1/2]

static TIGL_EXPORT std::vector<double> tigl::CTiglBSplineAlgorithms::computeParamsBSplineCurve ( const Handle(TColgp_HArray1OfPnt)&  points,
double  alpha = 0.5 
)
static

computeParamsBSplineCurve: Computes the parameters of a Geom_BSplineCurve at the given points

Parameters
pointsGiven points where new parameters are computed at
alphaExponent for the computation of the parameters; alpha=0.5 means, that this method uses the centripetal method

◆ computeParamsBSplineCurve() [2/2]

static TIGL_EXPORT std::vector<double> tigl::CTiglBSplineAlgorithms::computeParamsBSplineCurve ( const Handle(TColgp_HArray1OfPnt)&  points,
double  umin,
double  umax,
double  alpha = 0.5 
)
static

computeParamsBSplineCurve: Computes the parameters of a Geom_BSplineCurve at the given points

Parameters
pointsGiven points where new parameters are computed at
alphaExponent for the computation of the parameters; alpha=0.5 means, that this method uses the centripetal method
uminFirst parameter of the curve
umaxLast parameter of the curve

◆ computeParamsBSplineSurf()

static TIGL_EXPORT std::pair<std::vector<double>, std::vector<double> > tigl::CTiglBSplineAlgorithms::computeParamsBSplineSurf ( const TColgp_Array2OfPnt &  points,
double  alpha = 0.5 
)
static

computeParamsBSplineSurf: Computes the parameters of a Geom_BSplineSurface at the given points

Parameters
pointsGiven points where new parameters are computed at
alphaExponent for the computation of the parameters; alpha=0.5 means, that this method uses the centripetal method
Returns
a std::pair of Handle(TColStd_HArray1OfReal) of the parameters in u- and in v-direction

◆ createCommonKnotsVectorCurve()

static TIGL_EXPORT std::vector<Handle(Geom_BSplineCurve)> tigl::CTiglBSplineAlgorithms::createCommonKnotsVectorCurve ( const std::vector< Handle(Geom_BSplineCurve)> &  splines_vector,
double  tol 
)
static

createCommonKnotsVectorCurve: Creates a common knots vector of the given vector of B-splines The common knot vector contains all knots of all splines with the highest multiplicity of all splines.

Parameters
splines_vectorvector of B-splines that could have a different knot vector
Returns
the given vector of B-splines with a common knot vector, the B-spline geometry isn't changed

◆ createCommonKnotsVectorSurface()

static TIGL_EXPORT std::vector<Handle(Geom_BSplineSurface) > tigl::CTiglBSplineAlgorithms::createCommonKnotsVectorSurface ( const std::vector< Handle(Geom_BSplineSurface)> &  old_surfaces_vector,
SurfaceDirection  dir 
)
static

createCommonKnotsVectorSurface: Creates a common knot vector in both u- and / or v-direction of the given vector of B-spline surfaces The common knot vector contains all knots in u- and v-direction of all surfaces with the highest multiplicity of all surfaces.

Note: the parameter range of the surfaces must match before calling this function.

Parameters
old_surfaces_vectorthe given vector of B-spline surfaces that could have a different knot vector in u- and v-direction
dirDefines, which knot vector (u/v/both) is modified
Returns
the given vector of B-spline surfaces, now with a common knot vector The B-spline surface geometry remains the same.

◆ getKinkParameters() [1/2]

static TIGL_EXPORT std::vector<double> tigl::CTiglBSplineAlgorithms::getKinkParameters ( const Handle(Geom_BSplineCurve)&  curve)
static

Returns positions, where the curve has kinks (C1 Discontinuities)

◆ getKinkParameters() [2/2]

static TIGL_EXPORT SurfaceKinks tigl::CTiglBSplineAlgorithms::getKinkParameters ( const Handle(Geom_BSplineSurface)&  surface)
static

Returns positions, where the surface has kinks (C1 Discontinuities)

◆ Handle() [1/6]

static TIGL_EXPORT tigl::CTiglBSplineAlgorithms::Handle ( Geom_BSplineCurve  )
static

reparameterizePiecewiseLinear: Apply reparameterization on a given B-Spline curve defined by old and new parameters Based on algorithm found in The NURBS book (2nd edition), p. 251, and the explanations Here, we use a piecewise linear reparameterization function (degree q=1) interpolating the wanted parameters As a result, the degree stays the same after reparameterization

Parameters
paramsOldArray of the old parameters
paramsNewArray of the new parameters
toleranceDefine the tolerance used for OpenCascade knot removal funtion [Geom_BSplineCurve::RemoveKnot(Index, M, Tolerance)]

◆ Handle() [2/6]

static TIGL_EXPORT tigl::CTiglBSplineAlgorithms::Handle ( Geom_BSplineSurface  ) const
static

flipSurface: swaps axes of the given surface, i.e., surface(u-coord, v-coord) becomes surface(v-coord, u-coord)

Parameters
surfaceB-spline surface that shall be flipped
Returns
the given surface, but flipped

◆ Handle() [3/6]

static TIGL_EXPORT tigl::CTiglBSplineAlgorithms::Handle ( Geom_BSplineSurface  ) const &
static

pointsToSurface: interpolates a matrix of points by a B-spline surface with parameters in u- and in v-direction where the points shall be at ! Uses a skinned surface !

Parameters
pointsmatrix of points that shall be interpolated
uParamsparameters in u-direction where the points shall be at on the interpolating surface
vParamsparameters in v-direction where the points shall be at on the interpolating surface
uContinuousIfClosedMake a continuous junction in u d-directions, if the u direction is closed
vContinuousIfClosedMake a continuous junction in v d-directions, if the v direction is closed
Returns
B-spline surface which interpolates the given points with the given parameters

◆ Handle() [4/6]

static TIGL_EXPORT tigl::CTiglBSplineAlgorithms::Handle ( Geom_BSplineSurface  ) const &
static

Trims a bspline surface.

◆ Handle() [5/6]

static TIGL_EXPORT tigl::CTiglBSplineAlgorithms::Handle ( Geom_BSplineCurve  ) const &
static

Trims a bspline curve.

◆ Handle() [6/6]

static TIGL_EXPORT tigl::CTiglBSplineAlgorithms::Handle ( Geom_BSplineSurface  )
static

Concatenates a list of bspline curves.

@ brief Changes the knot sequence to be uniform after calling the function

Technically, this is done by approximating the surface with a new surface which also adds an approximation error. For the surface approximation, derivatives at the boundary are not taken into account yet.

The approximation error depends on the number of knot segments, the more segments are used, the better will be the result.

Parameters
surfSurface to approximate
nseg_uNumber of knot segments in u direction
nseg_vNumber of knot segments in v direction

Concatenates two surfaces in u direction

Note: This function has the following requirements

  • s2 follows s1 in u direction and have a common boundary
  • s2 follows s1 also in parametric domain
  • both surfaces are non-rational!
  • the surfaces a non-periodic in u direction

The resulting surface might not C1 and C2 continuous. We still have geometric continuity.

To achieve parametric continuity, the surfaces must be re-parametrized accordingly before

◆ intersections()

static TIGL_EXPORT std::vector<std::pair<double, double> > tigl::CTiglBSplineAlgorithms::intersections ( const Handle(Geom_BSplineCurve)  spline1,
const Handle(Geom_BSplineCurve)  spline2,
double  tolerance = 3e-4 
)
static

intersections: Returns all intersections of two B-splines

Parameters
spline1first B-spline
spline2second B-spline
tolerancerelative tolerance to check intersection (relative to overall size)
Returns
: intersections of spline1 with spline2 as a vector of (parameter of spline1, parameter of spline2)-pairs

◆ isUDirClosed()

static TIGL_EXPORT bool tigl::CTiglBSplineAlgorithms::isUDirClosed ( const TColgp_Array2OfPnt &  points,
double  tolerance 
)
static

Checks, whether the point matrix points is closed in u direction.

◆ isVDirClosed()

static TIGL_EXPORT bool tigl::CTiglBSplineAlgorithms::isVDirClosed ( const TColgp_Array2OfPnt &  points,
double  tolerance 
)
static

Checks, whether the point matrix points is closed in u direction.

◆ knotsFromCurveParameters()

static TIGL_EXPORT std::vector<double> tigl::CTiglBSplineAlgorithms::knotsFromCurveParameters ( std::vector< double > &  params,
unsigned int  degree,
bool  closedCurve 
)
static

Computes the knot vector for curve interpolation using parameter averaging This is required to prevent singular systems during interpolation.

◆ matchDegree()

static TIGL_EXPORT void tigl::CTiglBSplineAlgorithms::matchDegree ( const std::vector< Handle(Geom_BSplineCurve) > &  bsplines)
static

Matches the degree of all b-splines by raising the degree to the maximum degree.

Parameters
bsplinesThe splines to be matched (in/out)

◆ matchParameterRange()

static TIGL_EXPORT void tigl::CTiglBSplineAlgorithms::matchParameterRange ( const std::vector< Handle(Geom_BSplineCurve) > &  bsplines,
double  tolerance = 1e-15 
)
static

Matches the parameter range of all b-splines to the parameter range of the first b-spline.

Parameters
bsplinesThe splines to be matched (in/out)

◆ reparametrizeBSpline() [1/2]

static TIGL_EXPORT void tigl::CTiglBSplineAlgorithms::reparametrizeBSpline ( Geom_BSplineCurve &  spline,
double  umin,
double  umax,
double  tol = 1e-15 
)
static

Changes the parameter range of the b-spline curve

◆ reparametrizeBSpline() [2/2]

static TIGL_EXPORT void tigl::CTiglBSplineAlgorithms::reparametrizeBSpline ( Geom_BSplineSurface &  spline,
double  umin,
double  umax,
double  vmin,
double  vmax,
double  tol 
)
static

Changes the parameter range of the b-spline surfae

◆ reparametrizeBSplineContinuouslyApprox()

static TIGL_EXPORT CTiglApproxResult tigl::CTiglBSplineAlgorithms::reparametrizeBSplineContinuouslyApprox ( const Handle(Geom_BSplineCurve)  spline,
const std::vector< double > &  old_parameters,
const std::vector< double > &  new_parameters,
size_t  n_control_pnts 
)
static

reparametrizeBSplineContinuouslyApprox: Reparametrizes a given B-spline by giving an array of its old parameters that should have the values of the given array of new parameters after this function call. The B-spline geometry remains approximately the same, and: After this reparametrization the spline is continuously differentiable considering its parametrization

Parameters
old_parametersarray of the old parameters that shall have the values of the new parameters
new_parametersarray of the new parameters the old parameters should become
Returns
the continuously reparametrized given B-spline

◆ reparametrizeBSplineNiceKnots()

static TIGL_EXPORT CTiglApproxResult tigl::CTiglBSplineAlgorithms::reparametrizeBSplineNiceKnots ( Handle(Geom_BSplineCurve)  spline)
static

Reparametrizes the B-Spline such that the knot distribution is uniform and the number of Segments is a power of 2

The resulting curves are very suitable for lofting, as they share the same knots

◆ scale() [1/4]

static TIGL_EXPORT double tigl::CTiglBSplineAlgorithms::scale ( const std::vector< Handle(Geom_BSplineCurve)> &  splines_vector)
static

scale: Returns the approximate scale of the biggest given B-spline curve

Parameters
splines_vectorvector of B-spline curves
Returns
: the scale

◆ scale() [2/4]

static TIGL_EXPORT double tigl::CTiglBSplineAlgorithms::scale ( const Handle(Geom_BSplineCurve)&  spline)
static

scale: Returns the approximate scale of the B-spline curve

Parameters
splineB-spline curve
Returns
: the scale

◆ scale() [3/4]

static TIGL_EXPORT double tigl::CTiglBSplineAlgorithms::scale ( const TColgp_Array2OfPnt &  points)
static

Returns the scale of the point matrix.

◆ scale() [4/4]

static TIGL_EXPORT double tigl::CTiglBSplineAlgorithms::scale ( const TColgp_Array1OfPnt &  points)
static

Returns the scale of the point list by searching for the largest distance between two points.

Field Documentation

◆ nseg_u

TIGL_EXPORT unsigned int tigl::CTiglBSplineAlgorithms::nseg_u

◆ nseg_v

TIGL_EXPORT unsigned int unsigned int tigl::CTiglBSplineAlgorithms::nseg_v

◆ paramsNew

TIGL_EXPORT std::vector<double> const std::vector<double> const& tigl::CTiglBSplineAlgorithms::paramsNew

◆ paramsOld

TIGL_EXPORT std::vector<double> const& tigl::CTiglBSplineAlgorithms::paramsOld

◆ REL_TOL_CLOSED

TIGL_EXPORT const double tigl::CTiglBSplineAlgorithms::REL_TOL_CLOSED
static

Tolerance for closed curve detection.

◆ space_tol

TIGL_EXPORT Handle (Geom_BSplineCurve) concatCurves(std static TIGL_EXPORT double tigl::CTiglBSplineAlgorithms::space_tol =1e-5)

◆ tolerance

TIGL_EXPORT std::vector<double> const std::vector<double> const double tigl::CTiglBSplineAlgorithms::tolerance

◆ uContinuousIfClosed

TIGL_EXPORT const std::vector<double> const std::vector<double> bool tigl::CTiglBSplineAlgorithms::uContinuousIfClosed

◆ umax

static TIGL_EXPORT double double tigl::CTiglBSplineAlgorithms::umax

◆ umin

static TIGL_EXPORT double tigl::CTiglBSplineAlgorithms::umin

◆ uParams

TIGL_EXPORT const std::vector<double>& tigl::CTiglBSplineAlgorithms::uParams

◆ vContinuousIfClosed

TIGL_EXPORT const std::vector<double> const std::vector<double> bool bool tigl::CTiglBSplineAlgorithms::vContinuousIfClosed

◆ vmax

TIGL_EXPORT double double double double tigl::CTiglBSplineAlgorithms::vmax

◆ vmin

TIGL_EXPORT double double double tigl::CTiglBSplineAlgorithms::vmin

◆ vParams

TIGL_EXPORT const std::vector<double> const std::vector<double>& tigl::CTiglBSplineAlgorithms::vParams

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