TinySpline  0.7.0
Spline Library for a Multitude of Programming Languages
Public Types | Friends | List of all members
tinyspline::BSpline Class Reference

Public Types

enum  Type { Opened , Clamped , Beziers }
 

Friends

class Morphism
 

BSpline

 BSpline ()
 
 BSpline (const BSpline &other)
 
 BSpline (BSpline &&other)
 
 BSpline (size_t numControlPoints, size_t dimension=2, size_t degree=3, Type type=Type::Clamped)
 
virtual ~BSpline ()
 
BSplineoperator= (const BSpline &other)
 
BSplineoperator= (BSpline &&other)
 
DeBoorNet operator() (real knot) const
 
size_t degree () const
 
size_t order () const
 
size_t dimension () const
 
std::vector< real > controlPoints () const
 
Vec2 controlPointVec2At (size_t idx) const
 
Vec3 controlPointVec3At (size_t idx) const
 
Vec4 controlPointVec4At (size_t idx) const
 
std::vector< real > knots () const
 
real knotAt (size_t idx) const
 
size_t numControlPoints () const
 
DeBoorNet eval (real knot) const
 
std_real_vector_out evalAll (std_real_vector_in knots) const
 
std_real_vector_out sample (size_t num=0) const
 
DeBoorNet bisect (real value, real epsilon=(real) 0.0, bool persnickety=false, size_t index=0, bool ascending=true, size_t maxIter=50) const
 
Domain domain () const
 
bool isClosed (real epsilon=TS_POINT_EPSILON) const
 
FrameSeq computeRMF (std_real_vector_in knots, Vec3 *firstNormal=nullptr) const
 
BSpline subSpline (real knot0, real knot1) const
 
std_real_vector_out uniformKnotSeq (size_t num=100) const
 
std_real_vector_out equidistantKnotSeq (size_t num=100, size_t numSamples=0) const
 
ChordLengths chordLengths (std_real_vector_in knots) const
 
ChordLengths chordLengths (size_t numSamples=200) const
 
std::string toJson () const
 
void save (std::string path) const
 
void setControlPoints (const std::vector< real > &ctrlp)
 
void setControlPointVec2At (size_t idx, Vec2 &cp)
 
void setControlPointVec3At (size_t idx, Vec3 &cp)
 
void setControlPointVec4At (size_t idx, Vec4 &cp)
 
void setKnots (const std::vector< real > &knots)
 
void setKnotAt (size_t idx, real knot)
 
BSpline insertKnot (real knot, size_t num) const
 
BSpline split (real knot) const
 
BSpline tension (real beta) const
 
BSpline toBeziers () const
 
BSpline derive (size_t num=1, real eps=TS_POINT_EPSILON) const
 
BSpline elevateDegree (size_t amount, real eps=TS_POINT_EPSILON) const
 
BSpline alignWith (const BSpline &other, BSpline &otherAligned, real eps=TS_POINT_EPSILON) const
 
Morphism morphTo (const BSpline &other, real eps=TS_POINT_EPSILON) const
 
std::string toString () const
 
static BSpline interpolateCubicNatural (std_real_vector_in points, size_t dimension)
 
static BSpline interpolateCatmullRom (std_real_vector_in points, size_t dimension, real alpha=(real) 0.5, std::vector< real > *first=nullptr, std::vector< real > *last=nullptr, real epsilon=TS_POINT_EPSILON)
 
static BSpline parseJson (std::string json)
 
static BSpline load (std::string path)
 
static bool knotsEqual (real x, real y)
 

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