TinySpline  0.7.0
Spline Library for a Multitude of Programming Languages
tinysplinecxx.h
Go to the documentation of this file.
1 
3 #pragma once
4 
5 #include "tinyspline.h"
6 #include <vector>
7 #include <string>
8 
9 #ifndef TINYSPLINECXX_API
10 #define TINYSPLINECXX_API TINYSPLINE_API
11 #endif
12 
13 
14 
25 #ifdef TINYSPLINE_EMSCRIPTEN
26 
27 // Additional includes and namespaces.
28 #include <stdexcept>
29 #include <emscripten/bind.h>
30 using namespace emscripten;
31 
32 /* Used by value_objects to guard read-only properties. */
33 void inline
34 cannotWrite()
35 { throw std::runtime_error("cannot write read-only property"); }
36 
37 /* Allow clients to read exception messages in the Javascript binding. */
38 std::string
39 exceptionMessage(int ptr)
40 { return std::string(reinterpret_cast<std::exception *>(ptr)->what()); }
41 
42 // Map: std::vector <--> JS array
43 // https://github.com/emscripten-core/emscripten/issues/11070#issuecomment-717675128
44 namespace emscripten {
45 namespace internal {
46 template <typename T, typename Allocator>
47 struct BindingType<std::vector<T, Allocator>> {
48  using ValBinding = BindingType<val>;
49  using WireType = ValBinding::WireType;
50 
51  static WireType
52  toWireType(const std::vector<T, Allocator> &vec)
53  { return ValBinding::toWireType(val::array(vec)); }
54 
55  static std::vector<T, Allocator>
56  fromWireType(WireType value)
57  { return vecFromJSArray<T>(ValBinding::fromWireType(value)); }
58 };
59 
60 template <typename T>
61 struct TypeID<T, // this is ridiculous...
62  typename std::enable_if_t<std::is_same<
63  typename Canonicalized<T>::type,
64  std::vector<typename Canonicalized<T>::type::value_type,
65  typename Canonicalized<T>::type::allocator_type>>::value>> {
66  static constexpr TYPEID
67  get() { return TypeID<val>::get(); }
68 };
69 } // namespace internal
70 } // namespace emscripten
71 #endif
76 namespace tinyspline {
77 
82 typedef tsReal real;
96 #ifdef SWIG
97 using std_real_vector_in = std::vector<tinyspline::real> *;
98 using std_real_vector_out = std::vector<tinyspline::real> *;
99 #else
100 using std_real_vector_in = const std::vector<tinyspline::real> &;
101 using std_real_vector_out = std::vector<tinyspline::real>;
102 #endif
113 class TINYSPLINECXX_API Vec2 {
114 public:
115  Vec2();
116  Vec2(real x, real y);
117 
118  Vec2 operator+(const Vec2 &other);
119  Vec2 operator-(const Vec2 &other);
120  Vec2 operator*(real scalar);
121 
122  real x() const;
123  void setX(real val);
124  real y() const;
125  void setY(real val);
126  std::vector<real> values() const;
127 
128  Vec2 add(const Vec2 &other) const;
129  Vec2 subtract(const Vec2 &other) const;
130  Vec2 multiply(real scalar) const;
131  Vec2 normalize() const;
132  real magnitude() const;
133  real dot(const Vec2 &other) const;
134  real angle(const Vec2 &other) const;
135  real distance(const Vec2 &other) const;
136 
137  std::string toString() const;
138 
139 private:
140  real m_vals[2];
141 
142 #ifdef TINYSPLINE_EMSCRIPTEN
143 public:
144  void setValues(std::vector<real>) { cannotWrite(); }
145 #endif
146 };
147 
148 class TINYSPLINECXX_API Vec3 {
149 public:
150  Vec3();
151  Vec3(real x, real y, real z);
152 
153  Vec3 operator+(const Vec3 &other);
154  Vec3 operator-(const Vec3 &other);
155  Vec3 operator*(real scalar);
156 
157  real x() const;
158  void setX(real val);
159  real y() const;
160  void setY(real val);
161  real z() const;
162  void setZ(real val);
163  std::vector<real> values() const;
164 
165  Vec3 add(const Vec3 &other) const;
166  Vec3 subtract(const Vec3 &other) const;
167  Vec3 multiply(real scalar) const;
168  Vec3 cross(const Vec3 &other) const;
169  Vec3 normalize() const;
170  real magnitude() const;
171  real dot(const Vec3 &other) const;
172  real angle(const Vec3 &other) const;
173  real distance(const Vec3 &other) const;
174 
175  std::string toString() const;
176 
177 private:
178  real m_vals[3];
179 
180 #ifdef TINYSPLINE_EMSCRIPTEN
181 public:
182  void setValues(std::vector<real>) { cannotWrite(); }
183 #endif
184 };
185 
186 class TINYSPLINECXX_API Vec4 {
187 public:
188  Vec4();
189  Vec4(real x, real y, real z, real w);
190 
191  Vec4 operator+(const Vec4 &other);
192  Vec4 operator-(const Vec4 &other);
193  Vec4 operator*(real scalar);
194 
195  real x() const;
196  void setX(real val);
197  real y() const;
198  void setY(real val);
199  real z() const;
200  void setZ(real val);
201  real w() const;
202  void setW(real val);
203  std::vector<real> values() const;
204 
205  Vec4 add(const Vec4 &other) const;
206  Vec4 subtract(const Vec4 &other) const;
207  Vec4 multiply(real scalar) const;
208  Vec4 normalize() const;
209  real magnitude() const;
210  real dot(const Vec4 &other) const;
211  real angle(const Vec4 &other) const;
212  real distance(const Vec4 &other) const;
213 
214  std::string toString() const;
215 
216 private:
217  real m_vals[4];
218 
219 #ifdef TINYSPLINE_EMSCRIPTEN
220 public:
221  void setValues(std::vector<real>) { cannotWrite(); }
222 #endif
223 };
224 
225 #ifdef TINYSPLINE_EMSCRIPTEN
226 class VecMath {
227 public:
232  static Vec2
233  add2(const Vec2 &a, const Vec2 &b)
234  { return a.add(b); }
235 
236  static Vec3
237  add3(const Vec3 &a, const Vec3 &b)
238  { return a.add(b); }
239 
240  static Vec4
241  add4(const Vec4 &a, const Vec4 &b)
242  { return a.add(b); }
249  static Vec2
250  subtract2(const Vec2 &a, const Vec2 &b)
251  { return a.subtract(b); }
252 
253  static Vec3
254  subtract3(const Vec3 &a, const Vec3 &b)
255  { return a.subtract(b); }
256 
257  static Vec4
258  subtract4(const Vec4 &a, const Vec4 &b)
259  { return a.subtract(b); }
266  static Vec2
267  multiply2(const Vec2 &vec, real scalar)
268  { return vec.multiply(scalar); }
269 
270  static Vec3
271  multiply3(const Vec3 &vec, real scalar)
272  { return vec.multiply(scalar); }
273 
274  static Vec4
275  multiply4(const Vec4 &vec, real scalar)
276  { return vec.multiply(scalar); }
283  static Vec3
284  cross3(const Vec3 &a, Vec3 &b)
285  { return a.cross(b); }
292  static Vec2
293  normalize2(const Vec2 &vec)
294  { return vec.normalize(); }
295 
296  static Vec3
297  normalize3(const Vec3 &vec)
298  { return vec.normalize(); }
299 
300  static Vec4
301  normalize4(const Vec4 &vec)
302  { return vec.normalize(); }
309  static real
310  magnitude2(const Vec2 &vec)
311  { return vec.magnitude(); }
312 
313  static real
314  magnitude3(const Vec3 &vec)
315  { return vec.magnitude(); }
316 
317  static real
318  magnitude4(const Vec4 &vec)
319  { return vec.magnitude(); }
326  static real
327  dot2(const Vec2 &a, Vec2 &b)
328  { return a.dot(b); }
329 
330  static real
331  dot3(const Vec3 &a, Vec3 &b)
332  { return a.dot(b); }
333 
334  static real
335  dot4(const Vec4 &a, Vec4 &b)
336  { return a.dot(b); }
343  static real
344  angle2(const Vec2 &a, Vec2 &b)
345  { return a.angle(b); }
346 
347  static real
348  angle3(const Vec3 &a, Vec3 &b)
349  { return a.angle(b); }
350 
351  static real
352  angle4(const Vec4 &a, Vec4 &b)
353  { return a.angle(b); }
360  static real
361  distance2(const Vec2 &a, Vec2 &b)
362  { return a.distance(b); }
363 
364  static real
365  distance3(const Vec3 &a, Vec3 &b)
366  { return a.distance(b); }
367 
368  static real
369  distance4(const Vec4 &a, Vec4 &b)
370  { return a.distance(b); }
372 };
373 #endif
385 class TINYSPLINECXX_API Frame {
386 public:
387  Frame(Vec3 &position,
388  Vec3 &tangent,
389  Vec3 &normal,
390  Vec3 &binormal);
391 
392  Vec3 position() const;
393  Vec3 tangent() const;
394  Vec3 normal() const;
395  Vec3 binormal() const;
396 
397  std::string toString() const;
398 
399 private:
400  Vec3 m_position,
401  m_tangent,
402  m_normal,
403  m_binormal;
404 
405 #ifdef TINYSPLINE_EMSCRIPTEN
406 public:
407  Frame() {}
408  void setPosition(Vec3) { cannotWrite(); }
409  void setTangent(Vec3) { cannotWrite(); }
410  void setNormal(Vec3) { cannotWrite(); }
411  void setBinormal(Vec3) { cannotWrite(); }
412 #endif
413 };
414 
415 class TINYSPLINECXX_API FrameSeq {
416 public:
417  FrameSeq();
418  FrameSeq(const FrameSeq &other);
419  FrameSeq(FrameSeq &&other);
420  virtual ~FrameSeq();
421 
422  FrameSeq &operator=(const FrameSeq &other);
423  FrameSeq &operator=(FrameSeq &&other);
424 
425  size_t size() const;
426  Frame at(size_t idx) const;
427 
428  std::string toString() const;
429 
430 private:
431  tsFrame *m_frames;
432  size_t m_size;
433  FrameSeq(tsFrame *frames,
434  size_t len);
435  friend class BSpline;
436 };
449 class TINYSPLINECXX_API Domain {
450 public:
451  Domain(real min, real max);
452 
453  real min() const;
454  real max() const;
455 
456  std::string toString() const;
457 
458 private:
459  real m_min,
460  m_max;
461 
462 #ifdef TINYSPLINE_EMSCRIPTEN
463 public:
464  Domain()
466  {}
467  void setMin(real) { cannotWrite(); }
468  void setMax(real) { cannotWrite(); }
469 #endif
470 };
481 class TINYSPLINECXX_API DeBoorNet {
482 public:
483  DeBoorNet(const DeBoorNet &other);
484  DeBoorNet(DeBoorNet &&other);
485  virtual ~DeBoorNet();
486 
487  DeBoorNet & operator=(const DeBoorNet &other);
488  DeBoorNet & operator=(DeBoorNet &&other);
489 
490  real knot() const;
491  size_t index() const;
492  size_t multiplicity() const;
493  size_t numInsertions() const;
494  size_t dimension() const;
495  std::vector<real> points() const;
496  std::vector<real> result() const;
497 
511  Vec2 resultVec2(size_t idx = 0) const;
512 
526  Vec3 resultVec3(size_t idx = 0) const;
527 
541  Vec4 resultVec4(size_t idx = 0) const;
542 
543  std::string toString() const;
544 
545 private:
546  tsDeBoorNet m_net;
547 
548  /* Constructors & Destructors */
549  explicit DeBoorNet(tsDeBoorNet &data);
550 
551  friend class BSpline;
552 
553 #ifdef TINYSPLINE_EMSCRIPTEN
554 public:
555  DeBoorNet() : m_net(ts_deboornet_init()) {}
556  void setKnot(real) { cannotWrite(); }
557  void setIndex(size_t) { cannotWrite(); }
558  void setMultiplicity(size_t) { cannotWrite(); }
559  void setNumInsertions(size_t) { cannotWrite(); }
560  void setDimension(size_t) { cannotWrite(); }
561  void setPoints(std::vector<real>) { cannotWrite(); }
562  void setResult(std::vector<real>) { cannotWrite(); }
563 #endif
564 };
575 class Morphism;
576 class ChordLengths;
577 class TINYSPLINECXX_API BSpline {
578 public:
579  enum Type { Opened, Clamped, Beziers };
580 
581  /* Constructors & Destructors */
582  BSpline();
583  BSpline(const BSpline &other);
584  BSpline(BSpline &&other);
585  explicit BSpline(size_t numControlPoints,
586  size_t dimension = 2,
587  size_t degree = 3,
588  Type type = Type::Clamped);
589  virtual ~BSpline();
590 
591  /* Create from static method */
592  static BSpline interpolateCubicNatural(std_real_vector_in points,
593  size_t dimension);
594  static BSpline interpolateCatmullRom(std_real_vector_in points,
595  size_t dimension,
596  real alpha = (real) 0.5,
597  std::vector<real> *first = nullptr,
598  std::vector<real> *last = nullptr,
599  real epsilon = TS_POINT_EPSILON);
600  static BSpline parseJson(std::string json);
601  static BSpline load(std::string path);
602 
603  static bool knotsEqual(real x, real y);
604 
605  /* Operators */
606  BSpline & operator=(const BSpline &other);
607  BSpline & operator=(BSpline &&other);
608  DeBoorNet operator()(real knot) const;
609 
610  /* Accessors */
611  size_t degree() const;
612  size_t order() const;
613  size_t dimension() const;
614  std::vector<real> controlPoints() const;
615  Vec2 controlPointVec2At(size_t idx) const;
616  Vec3 controlPointVec3At(size_t idx) const;
617  Vec4 controlPointVec4At(size_t idx) const;
618  std::vector<real> knots() const;
619  real knotAt(size_t idx) const;
620 
621  /* Query */
622  size_t numControlPoints() const;
623  DeBoorNet eval(real knot) const;
624  std_real_vector_out evalAll(std_real_vector_in knots) const;
625  std_real_vector_out sample(size_t num = 0) const;
626  DeBoorNet bisect(real value,
627  real epsilon = (real) 0.0,
628  bool persnickety = false,
629  size_t index = 0,
630  bool ascending = true,
631  size_t maxIter = 50) const;
632  Domain domain() const;
633  bool isClosed(real epsilon = TS_POINT_EPSILON) const;
634  FrameSeq computeRMF(std_real_vector_in knots,
635  Vec3 *firstNormal = nullptr) const;
636  BSpline subSpline(real knot0, real knot1) const;
637  std_real_vector_out uniformKnotSeq(size_t num = 100) const;
638  std_real_vector_out equidistantKnotSeq(size_t num = 100,
639  size_t numSamples = 0) const;
640  ChordLengths chordLengths(std_real_vector_in knots) const;
641  ChordLengths chordLengths(size_t numSamples = 200) const;
642 
643  /* Serialization */
644  std::string toJson() const;
645  void save(std::string path) const;
646 
647  /* Modifications */
648  void setControlPoints(const std::vector<real> &ctrlp);
649  void setControlPointVec2At(size_t idx, Vec2 &cp);
650  void setControlPointVec3At(size_t idx, Vec3 &cp);
651  void setControlPointVec4At(size_t idx, Vec4 &cp);
652  void setKnots(const std::vector<real> &knots);
653  void setKnotAt(size_t idx, real knot);
654 
655  /* Transformations */
656  BSpline insertKnot(real knot, size_t num) const;
657  BSpline split(real knot) const;
658  BSpline tension(real beta) const;
659  BSpline toBeziers() const;
660  BSpline derive(size_t num = 1,
661  real eps = TS_POINT_EPSILON) const;
662  BSpline elevateDegree(size_t amount,
663  real eps = TS_POINT_EPSILON) const;
664  BSpline alignWith(const BSpline &other,
665  BSpline &otherAligned,
666  real eps = TS_POINT_EPSILON) const;
667  Morphism morphTo(const BSpline &other,
668  real eps = TS_POINT_EPSILON) const;
669 
670  /* Debug */
671  std::string toString() const;
672 
673 private:
674  tsBSpline m_spline;
675 
676  /* Constructors & Destructors */
677  explicit BSpline(tsBSpline &data);
678 
679  /* Needs to access ::spline. */
680  friend class Morphism;
681 
682 #ifdef TINYSPLINE_EMSCRIPTEN
683 public:
684  std_real_vector_out sample0() const { return sample(); }
685  std_real_vector_out sample1(size_t num) const { return sample(num); }
686  BSpline derive0() const { return derive(); }
687  BSpline derive1(size_t n) const { return derive(n); }
688  BSpline derive2(size_t n, real eps) const { return derive(n, eps); }
689 #endif
690 };
699 class TINYSPLINECXX_API Morphism {
700 public:
701  Morphism(const BSpline &origin,
702  const BSpline &target,
703  real epsilon = TS_POINT_EPSILON);
704 
705  BSpline origin() const;
706  BSpline target() const;
707  real epsilon() const;
708 
709  BSpline eval(real t);
710  BSpline operator()(real t);
711 
712  std::string toString() const;
713 private:
714  BSpline m_origin, m_target;
715  real m_epsilon;
716  BSpline m_originAligned, m_targetAligned;
717  BSpline m_buffer;
718 };
726 class TINYSPLINECXX_API ChordLengths {
727 public:
728  ChordLengths();
729  ChordLengths(const ChordLengths &other);
730  ChordLengths(ChordLengths &&other);
731  virtual ~ChordLengths();
732 
733  ChordLengths &operator=(const ChordLengths &other);
734  ChordLengths &operator=(ChordLengths &&other);
735 
736  BSpline spline() const;
737  std::vector<real> knots() const;
738  std::vector<real> lengths() const;
739  TS_DEPRECATED std::vector<real> values() const;
740  size_t size() const;
741 
742  real arcLength() const;
743  real lengthToKnot(real len) const;
744  real tToKnot(real t) const;
745  std_real_vector_out equidistantKnotSeq(size_t num = 100) const;
746 
747  std::string toString() const;
748 private:
749  BSpline m_spline;
750  real *m_knots, *m_lengths;
751  size_t m_size;
752  ChordLengths(const BSpline &spline,
753  real *knots,
754  real *lengths,
755  size_t size);
756  friend class BSpline;
757 };
760 }
761 
762 
763 
764 #ifdef TINYSPLINE_EMSCRIPTEN
765 using namespace tinyspline;
766 EMSCRIPTEN_BINDINGS(tinyspline) {
767  function("exceptionMessage", &exceptionMessage);
768 
769  // Vector Math
770  value_object<Vec2>("Vec2")
771  .field("x",
772  &Vec2::x,
773  &Vec2::setX)
774  .field("y",
775  &Vec2::y,
776  &Vec2::setY)
777  .field("values",
778  &Vec2::values,
779  &Vec2::setValues)
780  ;
781  value_object<Vec3>("Vec3")
782  .field("x",
783  &Vec3::x,
784  &Vec3::setX)
785  .field("y",
786  &Vec3::y,
787  &Vec3::setY)
788  .field("z",
789  &Vec3::z,
790  &Vec3::setZ)
791  .field("values",
792  &Vec3::values,
793  &Vec3::setValues)
794  ;
795  value_object<Vec4>("Vec4")
796  .field("x",
797  &Vec4::x,
798  &Vec4::setX)
799  .field("y",
800  &Vec4::y,
801  &Vec4::setY)
802  .field("z",
803  &Vec4::z,
804  &Vec4::setZ)
805  .field("w",
806  &Vec4::w,
807  &Vec4::setW)
808  .field("values",
809  &Vec4::values,
810  &Vec4::setValues)
811  ;
812  class_<VecMath>("VecMath")
813  .class_function("add", &VecMath::add2)
814  .class_function("add", &VecMath::add3)
815  .class_function("add", &VecMath::add4)
816  .class_function("subtract", &VecMath::subtract2)
817  .class_function("subtract", &VecMath::subtract3)
818  .class_function("subtract", &VecMath::subtract4)
819  .class_function("multiply", &VecMath::multiply2)
820  .class_function("multiply", &VecMath::multiply3)
821  .class_function("multiply", &VecMath::multiply4)
822  .class_function("cross", &VecMath::cross3)
823  .class_function("normalize", &VecMath::normalize2)
824  .class_function("normalize", &VecMath::normalize3)
825  .class_function("normalize", &VecMath::normalize4)
826  .class_function("magnitude", &VecMath::magnitude2)
827  .class_function("magnitude", &VecMath::magnitude3)
828  .class_function("magnitude", &VecMath::magnitude4)
829  .class_function("dot", &VecMath::dot2)
830  .class_function("dot", &VecMath::dot3)
831  .class_function("dot", &VecMath::dot4)
832  .class_function("angle", &VecMath::angle2)
833  .class_function("angle", &VecMath::angle3)
834  .class_function("angle", &VecMath::angle4)
835  .class_function("distance", &VecMath::distance2)
836  .class_function("distance", &VecMath::distance3)
837  .class_function("distance", &VecMath::distance4)
838  ;
839 
840  // Spline Framing
841  value_object<Frame>("Frame")
842  .field("position",
843  &Frame::position,
844  &Frame::setPosition)
845  .field("tangent",
846  &Frame::tangent,
847  &Frame::setTangent)
848  .field("normal",
849  &Frame::normal,
850  &Frame::setNormal)
851  .field("binormal",
852  &Frame::normal,
853  &Frame::setNormal)
854  ;
855  class_<FrameSeq>("FrameSeq")
856  .constructor<>()
857  .constructor<FrameSeq>()
858  .function("size", &FrameSeq::size)
859  .function("at", &FrameSeq::at)
860  .function("toString", &FrameSeq::toString)
861  ;
862 
863  // Utility Classes
864  value_object<Domain>("Domain")
865  .field("min",
866  &Domain::min,
867  &Domain::setMin)
868  .field("max",
869  &Domain::max,
870  &Domain::setMax)
871  ;
872 
873  value_object<DeBoorNet>("DeBoorNet")
874  .field("knot",
875  &DeBoorNet::knot,
876  &DeBoorNet::setKnot)
877  .field("index",
878  &DeBoorNet::index,
879  &DeBoorNet::setIndex)
880  .field("multiplicity",
881  &DeBoorNet::multiplicity,
882  &DeBoorNet::setMultiplicity)
883  .field("numInsertions",
884  &DeBoorNet::numInsertions,
885  &DeBoorNet::setNumInsertions)
886  .field("dimension",
887  &DeBoorNet::dimension,
888  &DeBoorNet::setDimension)
889  .field("points",
890  &DeBoorNet::points,
891  &DeBoorNet::setPoints)
892  .field("result",
893  &DeBoorNet::result,
894  &DeBoorNet::setResult)
895  ;
896 
897  class_<BSpline>("BSpline")
898  .constructor<>()
899  //.constructor<BSpline>()
900  .constructor<size_t>()
901  .constructor<size_t, size_t>()
902  .constructor<size_t, size_t, size_t>()
903  .constructor<size_t, size_t, size_t, BSpline::Type>()
904 
905  .class_function("interpolateCubicNatural",
906  &BSpline::interpolateCubicNatural)
907  .class_function("interpolateCatmullRom",
908  &BSpline::interpolateCatmullRom,
909  allow_raw_pointers())
910  .class_function("parseJson", &BSpline::parseJson)
911 
912  .property("degree", &BSpline::degree)
913  .property("order", &BSpline::order)
914  .property("dimension", &BSpline::dimension)
915  .property("controlPoints", &BSpline::controlPoints,
916  &BSpline::setControlPoints)
917  .property("knots", &BSpline::knots, &BSpline::setKnots)
918  .property("domain", &BSpline::domain)
919 
920  /* Property by index */
921  .function("knotAt", &BSpline::knotAt)
922  .function("setKnotAt", &BSpline::setKnotAt)
923 
924  /* Query */
925  .function("numControlPoints", &BSpline::numControlPoints)
926  .function("eval", &BSpline::eval)
927  .function("evalAll", &BSpline::evalAll)
928  .function("sample",
929  select_overload<std_real_vector_out() const>
930  (&BSpline::sample0))
931  .function("sample",
932  select_overload<std_real_vector_out(size_t) const>
933  (&BSpline::sample1))
934  .function("sample", &BSpline::sample)
935  .function("bisect", &BSpline::bisect)
936  .function("isClosed", &BSpline::isClosed)
937 
938  /* Serialization */
939  .function("toJson", &BSpline::toJson)
940 
941  /* Transformations */
942  .function("insertKnot", &BSpline::insertKnot)
943  .function("split", &BSpline::split)
944  .function("tension", &BSpline::tension)
945  .function("toBeziers", &BSpline::toBeziers)
946  .function("derive",
947  select_overload<BSpline() const>
948  (&BSpline::derive0))
949  .function("derive",
950  select_overload<BSpline(size_t) const>
951  (&BSpline::derive1))
952  .function("derive",
953  select_overload<BSpline(size_t, real) const>
954  (&BSpline::derive2))
955 
956  /* Debug */
957  .function("toString", &BSpline::toString)
958  ;
959 
960  enum_<BSpline::Type>("BSplineType")
961  .value("Opened", BSpline::Type::Opened)
962  .value("Clamped", BSpline::Type::Clamped)
963  .value("Beziers", BSpline::Type::Beziers)
964  ;
965 }
966 #endif
Definition: tinysplinecxx.h:577
Definition: tinysplinecxx.h:726
Definition: tinysplinecxx.h:481
Definition: tinysplinecxx.h:449
Definition: tinysplinecxx.h:415
Definition: tinysplinecxx.h:385
Definition: tinysplinecxx.h:699
Definition: tinysplinecxx.h:113
Definition: tinysplinecxx.h:148
Definition: tinysplinecxx.h:186
Definition: tinyspline.h:718
Definition: tinyspline.h:1308
Definition: tinyspline.h:665
#define TS_DOMAIN_DEFAULT_MAX
Definition: tinyspline.h:135
#define TS_DOMAIN_DEFAULT_MIN
Definition: tinyspline.h:128
double tsReal
Definition: tinyspline.h:213
#define TS_POINT_EPSILON
Definition: tinyspline.h:169
tsDeBoorNet TINYSPLINE_API ts_deboornet_init(void)
Definition: tinyspline.c:693