#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 ¶ms, 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 > ¶ms, 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... | |
|
static |
Computes a full blown bspline basis matrix of size (params.Length(), flatKnots.Length() + degree + 1)
degree | Degree of the bspline |
flatKnots | Flatted know vector |
params | Parameters of B-Spline evaluation |
|
static |
computeParamsBSplineCurve: Computes the parameters of a Geom_BSplineCurve at the given points
points | Given points where new parameters are computed at |
alpha | Exponent for the computation of the parameters; alpha=0.5 means, that this method uses the centripetal method |
|
static |
computeParamsBSplineCurve: Computes the parameters of a Geom_BSplineCurve at the given points
points | Given points where new parameters are computed at |
alpha | Exponent for the computation of the parameters; alpha=0.5 means, that this method uses the centripetal method |
umin | First parameter of the curve |
umax | Last parameter of the curve |
|
static |
computeParamsBSplineSurf: Computes the parameters of a Geom_BSplineSurface at the given points
points | Given points where new parameters are computed at |
alpha | Exponent for the computation of the parameters; alpha=0.5 means, that this method uses the centripetal method |
|
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.
splines_vector | vector of B-splines that could have a different knot vector |
|
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.
old_surfaces_vector | the given vector of B-spline surfaces that could have a different knot vector in u- and v-direction |
dir | Defines, which knot vector (u/v/both) is modified |
|
static |
Returns positions, where the curve has kinks (C1 Discontinuities)
|
static |
Returns positions, where the surface has kinks (C1 Discontinuities)
|
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
paramsOld | Array of the old parameters |
paramsNew | Array of the new parameters |
tolerance | Define the tolerance used for OpenCascade knot removal funtion [Geom_BSplineCurve::RemoveKnot(Index, M, Tolerance)] |
|
static |
flipSurface: swaps axes of the given surface, i.e., surface(u-coord, v-coord) becomes surface(v-coord, u-coord)
surface | B-spline surface that shall be flipped |
|
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 !
points | matrix of points that shall be interpolated |
uParams | parameters in u-direction where the points shall be at on the interpolating surface |
vParams | parameters in v-direction where the points shall be at on the interpolating surface |
uContinuousIfClosed | Make a continuous junction in u d-directions, if the u direction is closed |
vContinuousIfClosed | Make a continuous junction in v d-directions, if the v direction is closed |
|
static |
Trims a bspline surface.
|
static |
Trims a bspline curve.
|
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.
surf | Surface to approximate |
nseg_u | Number of knot segments in u direction |
nseg_v | Number of knot segments in v direction |
Concatenates two surfaces in u direction
Note: This function has the following requirements
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
|
static |
intersections: Returns all intersections of two B-splines
spline1 | first B-spline |
spline2 | second B-spline |
tolerance | relative tolerance to check intersection (relative to overall size) |
|
static |
Checks, whether the point matrix points is closed in u direction.
|
static |
Checks, whether the point matrix points is closed in u direction.
|
static |
Computes the knot vector for curve interpolation using parameter averaging This is required to prevent singular systems during interpolation.
|
static |
Matches the degree of all b-splines by raising the degree to the maximum degree.
bsplines | The splines to be matched (in/out) |
|
static |
Matches the parameter range of all b-splines to the parameter range of the first b-spline.
bsplines | The splines to be matched (in/out) |
|
static |
Changes the parameter range of the b-spline curve
|
static |
Changes the parameter range of the b-spline surfae
|
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
old_parameters | array of the old parameters that shall have the values of the new parameters |
new_parameters | array of the new parameters the old parameters should become |
|
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
|
static |
scale: Returns the approximate scale of the biggest given B-spline curve
splines_vector | vector of B-spline curves |
|
static |
scale: Returns the approximate scale of the B-spline curve
spline | B-spline curve |
|
static |
Returns the scale of the point matrix.
|
static |
Returns the scale of the point list by searching for the largest distance between two points.
TIGL_EXPORT unsigned int tigl::CTiglBSplineAlgorithms::nseg_u |
TIGL_EXPORT unsigned int unsigned int tigl::CTiglBSplineAlgorithms::nseg_v |
TIGL_EXPORT std::vector<double> const std::vector<double> const& tigl::CTiglBSplineAlgorithms::paramsNew |
TIGL_EXPORT std::vector<double> const& tigl::CTiglBSplineAlgorithms::paramsOld |
|
static |
Tolerance for closed curve detection.
TIGL_EXPORT Handle (Geom_BSplineCurve) concatCurves(std static TIGL_EXPORT double tigl::CTiglBSplineAlgorithms::space_tol =1e-5) |
TIGL_EXPORT std::vector<double> const std::vector<double> const double tigl::CTiglBSplineAlgorithms::tolerance |
TIGL_EXPORT const std::vector<double> const std::vector<double> bool tigl::CTiglBSplineAlgorithms::uContinuousIfClosed |
static TIGL_EXPORT double double tigl::CTiglBSplineAlgorithms::umax |
static TIGL_EXPORT double tigl::CTiglBSplineAlgorithms::umin |
TIGL_EXPORT const std::vector<double>& tigl::CTiglBSplineAlgorithms::uParams |
TIGL_EXPORT const std::vector<double> const std::vector<double> bool bool tigl::CTiglBSplineAlgorithms::vContinuousIfClosed |
TIGL_EXPORT double double double double tigl::CTiglBSplineAlgorithms::vmax |
TIGL_EXPORT double double double tigl::CTiglBSplineAlgorithms::vmin |
TIGL_EXPORT const std::vector<double> const std::vector<double>& tigl::CTiglBSplineAlgorithms::vParams |