10 #include <AtomsUtils/Globals.h>
11 #include <AtomsUtils/AtomsMath.h>
29 Curve(
const std::vector<AtomsMath::Vector3f> cvs,
unsigned int degree);
66 std::vector<float>
basis(
int knotSpan,
float u)
const;
72 std::vector<std::vector<float> >
dersBasis(
int knotSpan,
float u,
unsigned int degree)
const;
91 std::vector<AtomsMath::Vector3f>
curveDerivs(
float param,
unsigned int nderiv)
const;
98 std::vector<AtomsMath::Vector3f>
parallelFrameNormals(
unsigned int samples, AtomsMath::Vector3f upVec)
const;
114 virtual std::pair<float,AtomsMath::Vector3f>
closestPoint(
const AtomsMath::Vector3f& point,
unsigned int maxStep = 6,
unsigned int maxIterations = 10,
float tollarence = 0.0001f);
122 virtual std::pair<float, AtomsMath::Vector3f>
closestTangent(
const AtomsMath::Vector3f& point,
unsigned int maxStep = 6,
unsigned int maxIterations = 10,
float tollarence = 0.0001f);
128 std::vector<AtomsMath::Vector3f>&
cvs();
131 const std::vector<AtomsMath::Vector3f>&
cvs()
const;
137 const std::vector<float>&
knots()
const;
151 std::vector<AtomsMath::Vector3f> m_cvs;
154 std::vector<float> m_knots;
157 unsigned int m_degree;
Nurbs curve.
Definition: Curve.h:18
const Curve & operator=(const Curve &curve)
Assign operator.
int findSpan(float u) const
Find span.
const std::vector< AtomsMath::Vector3f > & cvs() const
Ge curve cvs.
Curve(const std::vector< AtomsMath::Vector3f > cvs, unsigned int degree)
Constructor.
AtomsMath::Vector3f tangentOnCurve(float param) const
Get a tangent on the curve.
std::vector< AtomsMath::Vector3f > parallelFrameNormals(unsigned int samples, AtomsMath::Vector3f upVec) const
Get curve normals using parallel frame.
const std::vector< float > & knots() const
Get curve knots.
AtomsMath::Matrixf parallelFrameAtPoint(unsigned int samples, AtomsMath::Vector3f upVec, float param) const
Get curve normal on a point using parallel frame.
AtomsMath::Vector3f pointOnCurve(float param) const
Get a point on the curve.
float maxU() const
Max U value.
std::vector< AtomsMath::Vector3f > curveDerivs(float param, unsigned int nderiv) const
Return the curve derivative.
virtual ~Curve()
Destructor.
int findMult(int r) const
Find multiplicity.
unsigned int degree() const
Get curve degree.
std::vector< std::vector< float > > dersBasis(int knotSpan, float u, unsigned int degree) const
Basis function for B-Spline.
std::vector< float > & knots()
Get curve knots.
std::vector< AtomsMath::Vector3f > & cvs()
Get curve cvs.
int findKnot(float u) const
Find span.
void computeUniformKnots()
Compute uniform knots.
virtual std::pair< float, AtomsMath::Vector3f > closestTangent(const AtomsMath::Vector3f &point, unsigned int maxStep=6, unsigned int maxIterations=10, float tollarence=0.0001f)
Get closest tangent.
virtual std::pair< float, AtomsMath::Vector3f > closestPoint(const AtomsMath::Vector3f &point, unsigned int maxStep=6, unsigned int maxIterations=10, float tollarence=0.0001f)
Get closest point.
void setDegree(unsigned int degree)
Set curve degree.
std::vector< float > basis(int knotSpan, float u) const
Basis function for B-Spline.
AtomsCore namespace.
Definition: Base64.h:13