11 #include <Base/Math/Vector3.hh>
12 #include <Base/Debug/Error.hh>
13 #include "NurbsBase.hh"
30 template <
class ControlPo
intsT>
41 Nurbs3D(
int knotsPerDim = 4,
int degree = 2);
52 void Init(
const ControlPointsT minX,
const ControlPointsT maxX,
53 const ControlPointsT minY,
const ControlPointsT maxY,
54 const ControlPointsT minZ,
const ControlPointsT maxZ);
77 inline void SetCtrlPoint(
const int &indexU,
const int &indexV,
const int &indexW,
const ControlPointsT &value){
78 BIASASSERT(indexU >= 0);
80 BIASASSERT(indexV >= 0);
82 BIASASSERT(indexW >= 0);
92 inline ControlPointsT
GetCtrlPoint(
const int &indexU,
const int &indexV,
const int &indexW)
const{
93 BIASASSERT(indexU >= 0);
95 BIASASSERT(indexV >= 0);
97 BIASASSERT(indexW >= 0);
110 result = (
BaseFunc(0,x,
degree_,nurbsParam[0],baseFuncCache)*
BaseFunc(1,y,
degree_,nurbsParam[1],baseFuncCache)*
BaseFunc(2,z,
degree_,nurbsParam[2],baseFuncCache));
119 for (
int i = 0; i < 3; i++){
void GetRelevantBaseCtrlPoints(const BIAS::Vector3< double > &nurbsParam, BIAS::Vector3< int > &begin, BIAS::Vector3< int > &end) const
for a given point in the parameter space, this functions yields for each dimension the first and the ...
int degree_
Degree of the b-splines.
friend class AdvancedOptimizerNurbs3D
void SetCtrlPoint(const int &indexU, const int &indexV, const int &indexW, const ControlPointsT &value)
Set the value of a specific control point.
double BaseFunc(const int &dim, const int &knot, const int °ree, const double &u) const
This is a serial implementation of the recursive nurbs evaluation.
ControlPointsT *** controlPoints_
The array of control points.
void EvalBaseFunc(const int x, const int y, const int z, const BIAS::Vector3< double > &nurbsParam, double &result, double *baseFuncCache) const
Evaluate the base function for the control point (x,y,z) for the point nurbsParam using a dedicated c...
void Init(const ControlPointsT minX, const ControlPointsT maxX, const ControlPointsT minY, const ControlPointsT maxY, const ControlPointsT minZ, const ControlPointsT maxZ)
Very generic initialization function for the control points.
std::vector< BIAS::Vector3< int > > sphereCtrlPoints_
A vector containing the control points in the vicinity of the hyper sphere.
ControlPointsT GetCtrlPoint(const int &indexU, const int &indexV, const int &indexW) const
Get the value of a specific control point.
Base class for NURBS classes.
std::vector< std::vector< double > > knotVector_
The vector of knot vectors (One for each dimension)
friend class SimpleOptimizerNurbs3D
Nurbs3D(int knotsPerDim=4, int degree=2)
Standard Constructor.
This class implements a NURBS-function with a three dimensional parameter space (A NURBS volume)...
void Eval(const BIAS::Vector3< double > &nurbsParam, ControlPointsT &result) const
Evaluate the NURBS function at a given point in the parameter space.
void EvalBaseFunc(const int x, const int y, const int z, const BIAS::Vector3< double > &nurbsParam, double &result) const
Evaluate the base function for the control point (x,y,z) for the point nurbsParam.
int numCtrlPoints_
The number of control points per dimension.
double *** weights_
The corresponding weights to the function points.