20#ifndef NURBS_CURVE_FMATVEC_H_
21#define NURBS_CURVE_FMATVEC_H_
23#include <mbsim/numerics/nurbs/nurbs_defs.h>
26 typedef Matrix<General, Fixed<4>, Var,
double> Mat4xV;
28 typedef Matrix<General, Var, Fixed<4>,
double> MatVx4;
62 const fmatvec::MatVx4 &
ctrlPnts()
const {
return P; }
64 const fmatvec::Vec4
ctrlPnts(
int i)
const {
return trans(P.row(i)); }
66 const fmatvec::VecV&
knot()
const {
return U; }
68 double knot(
int i)
const {
return U(i); }
70 const fmatvec::VecV
getuVec()
const {
return u; }
72 void setKnot(
const fmatvec::VecV& U_) { U = U_; }
73 void setCtrlPnts(
const fmatvec::MatVx4& P_) { P = P_; }
74 void setDegree(
int deg_) { deg = deg_; }
75 void setu(
const fmatvec::VecV& u_) { u = u_; }
77 void resize(
int n,
int Deg);
103 void deriveAtH(
double u,
int d, fmatvec::MatVx4 & ders)
const;
171 void globalInterp(
const fmatvec::MatVx3& Q,
double uMin,
double uMax,
int d,
bool updateLater =
false);
173 void globalInterpH(
const fmatvec::MatVx4& Qw,
int d, Method method=chordLength);
174 void globalInterpH(
const fmatvec::MatVx4& Qw,
const fmatvec::VecV& ub,
const fmatvec::VecV& Uc,
int d,
bool updateLater =
false);
178 void globalInterpClosed(
const fmatvec::MatVx3 & Q,
double uMin,
double uMax,
int d,
bool updateLater =
false);
184 void update(
const fmatvec::MatVx4& Qw);
186 void globalInterpClosedH(
const fmatvec::MatVx4& Qw,
int d, Method method=chordLength);
187 void globalInterpClosedH(
const fmatvec::MatVx4& Qw,
const fmatvec::VecV& ub,
const fmatvec::VecV& Uc,
int d,
bool updateLater =
false);
278 int findSpan(
double u)
const;
282 fmatvec::Vector<fmatvec::Ref, int> Aipiv;
283 fmatvec::SquareMatrix<fmatvec::Ref, double> ALU;
288 void knotAveraging(
const std::vector<double>& uk,
int deg);
289 double chordLengthParam(
const fmatvec::MatVx3& Q, fmatvec::VecV& ub);
290 double chordLengthParamH(
const fmatvec::MatVx4& Q, fmatvec::VecV& ub);
291 double chordLengthParamClosedH(
const fmatvec::MatVx4& Q, fmatvec::VecV& ub,
int d);
292 void updateUVecs(
double uMin,
double uMax);
294 void knotAveragingClosed(
const std::vector<double>& uk,
int deg);
295 void updateUVecsClosed(
double uMin,
double uMax);
302 void knotAveraging(
const fmatvec::VecV& uk,
int deg, fmatvec::VecV& U);
304 void updateUVecs(
double uMin,
double uMax, fmatvec::VecV& u,
int deg, fmatvec::VecV& U);
305 void updateUVecsClosed(
double uMin,
double uMax, fmatvec::VecV& u,
int deg, fmatvec::VecV& U);
306 void basisFuns(
double u,
int span,
int deg,
const fmatvec::VecV & U, fmatvec::VecV& funs);
307 void dersBasisFuns(
int n,
double u,
int span,
int deg,
const fmatvec::VecV & U, fmatvec::Mat& ders);
class that copies the nurbs++-library using the fmatvec as a basis-math-library
Definition: nurbs_curve.h:38
double knot(int i) const
the i-th knot
Definition: nurbs_curve.h:68
NurbsCurve()=default
standard constructor
void globalInterpClosed(const fmatvec::MatVx3 &Q, double uMin, double uMax, int d, bool updateLater=false)
closed interpolation of the given (not yet wrapped) points at the given knot vector "ub" in a degree ...
Definition: nurbs_curve.cc:215
void update(const fmatvec::MatVx3 &Q)
update the control points with the same matrix as before
void globalInterp(const std::vector< fmatvec::Point< 3 > > &Q, const std::vector< double > &uk, int d, bool updateLater=false)
do global interpolation for given interpolation-points list and knots with the given degree
Definition: nurbs_curve.cc:105
const fmatvec::Vec4 ctrlPnts(int i) const
a reference to one of the control points
Definition: nurbs_curve.h:64
int degree() const
a reference to the degree of the curve
Definition: nurbs_curve.h:60
const fmatvec::VecV getuVec() const
a reference to the parametric points
Definition: nurbs_curve.h:70
const fmatvec::VecV & knot() const
a reference to the vector of knots
Definition: nurbs_curve.h:66
fmatvec::HPoint< 3 > hpointAt(double u) const
calls operator()
Definition: nurbs_curve.h:87
const fmatvec::MatVx4 & ctrlPnts() const
a reference to the vector of control points
Definition: nurbs_curve.h:62
wrapper class for nurbs type HPoint
Definition: nurbs_defs.h:42
wrapper class for nurbs type Point
Definition: nurbs_defs.h:13
namespace MBSim
Definition: bilateral_constraint.cc:30
void binomialCoef(MatV &Bin)
Setup a matrix containing binomial coefficients.
Definition: nurbs_curve.cc:833
void knotAveragingClosed(const VecV &uk, int deg, VecV &U)
generates a knot vector using the averaging technique for interpolation with closed curve.
Definition: nurbs_curve.cc:631