Mondschein Engine  0.3.0
Public Member Functions | List of all members
mondschein::math::NURBScurve Class Reference

This class represents a NURBS curve. More...

#include <nurbscurve.h>

Public Member Functions

virtual Eigen::Vector3d operator() (float64 _t) const
 Curve point access operator. More...
 
virtual void set_degree (uint32 _d)
 Set the curve degree. More...
 
virtual uint32 get_degree () const
 Get the curve degree. More...
 
virtual void set_points (const std::vector< Eigen::Vector4d > &_p)
 Set the interpolation points. More...
 
virtual std::vector
< Eigen::Vector4d > 
get_points () const
 Get the interpolation points. More...
 
virtual void calc_knots (bool _cl)
 Calculate the knot vector. More...
 
virtual Eigen::Vector3d get_point (float64 _t) const
 Get a curve point. More...
 

Detailed Description

This class represents a NURBS curve.

The NURBScurve class contains the parametric representation of a NURBS curve. Since NURBS curves are the most generalized of B-Spline curves it also covers any B-Spline curve available.
Any NURBS curve is defined by a set of n control points and its degree.

Definition at line 41 of file nurbscurve.h.

Member Function Documentation

void NURBScurve::calc_knots ( bool  _cl)
virtual

Calculate the knot vector.

Parameters
_clif TRUE the knot vector is calculated in chord length, uniform length otherwise
Exceptions
mondschein::exceptionfirst known exception called during knot vector calculation

NOTE: The knot vector must always be recalculated after changing the curve degree or interpolation points. Otherwise the interpolation may be incorrect.

Definition at line 160 of file nurbscurve.cpp.

uint32 NURBScurve::get_degree ( ) const
virtual

Get the curve degree.

Returns
the curve degree value

Definition at line 144 of file nurbscurve.cpp.

Eigen::Vector3d NURBScurve::get_point ( float64  _t) const
virtual

Get a curve point.

Parameters
_tthe location between [0,1] of the curve point
Returns
the vector of the interpolated curve point
Exceptions
mondschein::exceptionif a known exception has been thrown during execution or if the knot vector is empty

NOTE: Before a curve point can be interpolated it must be made sure that the knot vector has been calculated.

See Also
operator()(float64 _t) const

Definition at line 177 of file nurbscurve.cpp.

std::vector< Eigen::Vector4d > NURBScurve::get_points ( ) const
virtual

Get the interpolation points.

Returns
the interpolation points of *this

Definition at line 155 of file nurbscurve.cpp.

Eigen::Vector3d NURBScurve::operator() ( float64  _t) const
virtual

Curve point access operator.

Parameters
_tthe location between [0,1] of the curve point
Returns
the vector of the interpolated curve point
Exceptions
mondschein::exceptionif a known exception has ben thrown during execution

NOTE: Before a curve point can be interpolated it must be made sure that the knot vector has been calculated.

See Also
get_point(float64 _t) const

Definition at line 122 of file nurbscurve.cpp.

void NURBScurve::set_degree ( uint32  _d)
virtual

Set the curve degree.

Parameters
_dthe curve degree
Exceptions
mondschein::exceptionif _d is not smaller than the number of interpolation points

NOTE: If the knot vector is not recalculated after changing the curve degree the interpolation may be incorrect.

Definition at line 137 of file nurbscurve.cpp.

void NURBScurve::set_points ( const std::vector< Eigen::Vector4d > &  _p)
virtual

Set the interpolation points.

Parameters
_pthe interpolation points
Exceptions
mondschein::exceptionif _p.size() <= curve degree

NOTE: If the knot vector is not recalculated after changing the interpolation points the interpolation may be incorrect.

Definition at line 149 of file nurbscurve.cpp.


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