TinySpline
Spline Library for a Multitude of Programming Languages
v0.3.0
tinyspline.h
Go to the documentation of this file.
1 
3 #ifndef TINYSPLINE_H
4 #define TINYSPLINE_H
5 
6 #include <stddef.h>
7 
8 #ifdef __cplusplus
9 extern "C" {
10 #endif
11 
12 /******************************************************************************
13 * *
14 * :: Predefined Constants *
15 * *
16 * The following constants should only be changed with caution because *
17 * they have been aligned to maintain internal consistency. The default values *
18 * should be suitable for almost all environments. *
19 * *
20 ******************************************************************************/
24 #define TS_MAX_NUM_KNOTS 10000
25 
30 #define TS_DOMAIN_DEFAULT_MIN 0.0f
31 
36 #define TS_DOMAIN_DEFAULT_MAX 1.0f
37 
42 #define TS_KNOT_EPSILON 1e-4f
43 
52 #define TS_CONTROL_POINT_EPSILON 1e-6f
53 
54 
55 
56 /******************************************************************************
57 * *
58 * :: API Configuration *
59 * *
60 ******************************************************************************/
61 #ifdef TINYSPLINE_FLOAT_PRECISION
62 typedef float tsReal;
63 #else
64 typedef double tsReal;
65 #endif
66 
67 
68 
69 /******************************************************************************
70 * *
71 * :: Error Handling *
72 * *
73 * The following enums, structs, and macros are used to define and handle *
74 * different types of errors. Use them as follows: *
75 * *
76 * tsStatus status; *
77 * TS_TRY(any_label, status.code, &status) *
78 * // Wrap function calls with TS_CALL. *
79 * TS_CALL(any_label, status.code, ts_bspline_to_beziers( *
80 * &spline, &beziers, &status)) *
81 * if (...) *
82 * // Use one of the TS_THROW macros to raise an error. *
83 * TS_THROW_0(any_label, &status, TS_MALLOC, "out of memory") *
84 * TS_CATCH(status.code) *
85 * // Executed on error. *
86 * printf(status.message); *
87 * TS_FINALLY *
88 * // Executed in any case. *
89 * TS_END_TRY *
90 * *
91 * Although it is always advisable to properly handle errors, embedding your *
92 * code into a TS_TRY/TS_END_TRY block as well as passing a pointer to a *
93 * tsStatus object is entirely optional: *
94 * *
95 * ts_bspline_to_beziers(&spline, &beziers, NULL); *
96 * *
97 * Yet, you may check if a particular function failed, albeit you don't have *
98 * access to the error message: *
99 * *
100 * if (ts_bspline_to_beziers(&spline, &beziers, NULL)) *
101 * // an error occurred *
102 * *
103 ******************************************************************************/
107 typedef enum {
109  TS_MALLOC = -1,
110  TS_DIM_ZERO = -2,
118  TS_IO_ERROR = -11,
121  TS_NO_RESULT = -14,
123 } tsError;
124 
128 typedef struct {
130  char message[100];
131 } tsStatus;
132 
133 #define TS_TRY(label, error, status) \
134 { \
135  (error) = TS_SUCCESS; \
136  if ((status) != NULL) { \
137  (status)->code = TS_SUCCESS; \
138  (status)->message[0] = '\0'; \
139  } \
140  __ ## label ## __: \
141  if (!(error)) {
142 
143 #define TS_CALL(label, error, call) \
144  (error) = (call); \
145  if ((error)) goto __ ## label ## __;
146 
147 #define TS_CATCH(error) \
148  } if ((error)) {
149 
150 #define TS_FINALLY \
151  } {
152 
153 #define TS_END_TRY \
154  } \
155 }
156 
157 #define TS_END_TRY_RETURN(error) \
158  TS_END_TRY return (error);
159 
160 #define TS_END_TRY_ROE(error) \
161  TS_END_TRY if ((error)) return error;
162 
163 #define TS_CALL_ROE(error, call) \
164 { \
165  (error) = (call); \
166  if ((error)) return error; \
167 }
168 
169 #define TS_RETURN_SUCCESS(status) \
170 { \
171  if ((status) != NULL) { \
172  (status)->code = TS_SUCCESS; \
173  (status)->message[0] = '\0'; \
174  } \
175  return TS_SUCCESS; \
176 }
177 
178 #define TS_RETURN_0(status, error, msg) \
179 { \
180  if ((status) != NULL) { \
181  (status)->code = error; \
182  sprintf((status)->message, msg); \
183  } \
184  return error; \
185 }
186 
187 #define TS_RETURN_1(status, error, msg, arg1) \
188 { \
189  if ((status) != NULL) { \
190  (status)->code = error; \
191  sprintf((status)->message, msg, arg1); \
192  } \
193  return error; \
194 }
195 
196 #define TS_RETURN_2(status, error, msg, arg1, arg2) \
197 { \
198  if ((status) != NULL) { \
199  (status)->code = error; \
200  sprintf((status)->message, msg, arg1, arg2); \
201  } \
202  return error; \
203 }
204 
205 #define TS_RETURN_3(status, error, msg, arg1, arg2, arg3) \
206 { \
207  if ((status) != NULL) { \
208  (status)->code = error; \
209  sprintf((status)->message, msg, arg1, arg2, arg3); \
210  } \
211  return error; \
212 }
213 
214 #define TS_THROW_0(label, error, status, val, msg) \
215 { \
216  (error) = val; \
217  if ((status) != NULL) { \
218  (status)->code = val; \
219  sprintf((status)->message, msg); \
220  } \
221  goto __ ## label ## __; \
222 }
223 
224 #define TS_THROW_1(label, error, status, val, msg, arg1) \
225 { \
226  (error) = val; \
227  if ((status) != NULL) { \
228  (status)->code = val; \
229  sprintf((status)->message, msg, arg1); \
230  } \
231  goto __ ## label ## __; \
232 }
233 
234 #define TS_THROW_2(label, error, status, val, msg, arg1, arg2) \
235 { \
236  (error) = val; \
237  if ((status) != NULL) { \
238  (status)->code = val; \
239  sprintf((status)->message, msg, arg1, arg2); \
240  } \
241  goto __ ## label ## __; \
242 }
243 
244 #define TS_THROW_3(label, error, status, val, msg, arg1, arg2, arg3) \
245 { \
246  (error) = val; \
247  if ((status) != NULL) { \
248  (status)->code = val; \
249  sprintf((status)->message, msg, arg1, arg2, arg3); \
250  } \
251  goto __ ## label ## __; \
252 }
253 
254 
255 
256 /******************************************************************************
257 * *
258 * :: Data Types *
259 * *
260 * Using the PIMPL design pattern, the internal fields of the data types are *
261 * encapsulated and can only be accessed by calling the corresponding field *
262 * access functions. *
263 * *
264 ******************************************************************************/
271 typedef enum
272 {
273  /* Uniformly spaced knot vector. */
274  TS_OPENED = 0,
275 
276  /* Uniformly spaced knot vector with clamped end knots. */
277  TS_CLAMPED = 1,
278 
279  /* Uniformly spaced knot vector with s(u) = order of spline. */
280  TS_BEZIERS = 2
281 } tsBSplineType;
282 
309 typedef struct
310 {
312 } tsBSpline;
313 
372 typedef struct
373 {
375 } tsDeBoorNet;
376 
377 
378 
379 /******************************************************************************
380 * *
381 * :: Field Access Functions *
382 * *
383 ******************************************************************************/
392 size_t ts_bspline_degree(const tsBSpline *spline);
393 
408 tsError ts_bspline_set_degree(tsBSpline *spline, size_t deg, tsStatus *status);
409 
418 size_t ts_bspline_order(const tsBSpline *spline);
419 
436 tsError ts_bspline_set_order(tsBSpline *spline, size_t order,
437  tsStatus *status);
438 
450 size_t ts_bspline_dimension(const tsBSpline *spline);
451 
477  tsStatus *status);
478 
487 size_t ts_bspline_len_control_points(const tsBSpline *spline);
488 
497 size_t ts_bspline_num_control_points(const tsBSpline *spline);
498 
508 size_t ts_bspline_sof_control_points(const tsBSpline *spline);
509 
524 tsError ts_bspline_control_points(const tsBSpline *spline, tsReal **ctrlp,
525  tsStatus *status);
526 
545 tsError ts_bspline_control_point_at(const tsBSpline *spline, size_t index,
546  tsReal **ctrlp, tsStatus *status);
547 
560 tsError ts_bspline_set_control_points(tsBSpline *spline, const tsReal *ctrlp,
561  tsStatus *status);
562 
581  const tsReal *ctrlp, tsStatus *status);
582 
591 size_t ts_bspline_num_knots(const tsBSpline *spline);
592 
602 size_t ts_bspline_sof_knots(const tsBSpline *spline);
603 
618 tsError ts_bspline_knots(const tsBSpline *spline, tsReal **knots,
619  tsStatus *status);
620 
637 tsError ts_bspline_knot_at(const tsBSpline *spline, size_t index, tsReal *knot,
638  tsStatus *status);
639 
656 tsError ts_bspline_set_knots(tsBSpline *spline, const tsReal *knots,
657  tsStatus *status);
658 
680 tsError ts_bspline_set_knot_at(tsBSpline *spline, size_t index, tsReal knot,
681  tsStatus *status);
682 
683 /* ------------------------------------------------------------------------- */
684 
693 tsReal ts_deboornet_knot(const tsDeBoorNet *net);
694 
703 size_t ts_deboornet_index(const tsDeBoorNet *net);
704 
713 size_t ts_deboornet_multiplicity(const tsDeBoorNet *net);
714 
725 size_t ts_deboornet_num_insertions(const tsDeBoorNet *net);
726 
738 size_t ts_deboornet_dimension(const tsDeBoorNet *net);
739 
748 size_t ts_deboornet_len_points(const tsDeBoorNet *net);
749 
758 size_t ts_deboornet_num_points(const tsDeBoorNet *net);
759 
769 size_t ts_deboornet_sof_points(const tsDeBoorNet *net);
770 
785 tsError ts_deboornet_points(const tsDeBoorNet *net, tsReal **points,
786  tsStatus *status);
787 
796 size_t ts_deboornet_len_result(const tsDeBoorNet *net);
797 
807 size_t ts_deboornet_num_result(const tsDeBoorNet *net);
808 
818 size_t ts_deboornet_sof_result(const tsDeBoorNet *net);
819 
834 tsError ts_deboornet_result(const tsDeBoorNet *net, tsReal **result,
835  tsStatus *status);
836 
837 
838 
839 /******************************************************************************
840 * *
841 * :: Constructors, Destructors, Copy, and Move Functions *
842 * *
843 ******************************************************************************/
851 
879 tsError ts_bspline_new(size_t num_control_points, size_t dimension,
880  size_t degree, tsBSplineType type, tsBSpline *spline,
881  tsStatus *status);
882 
898 tsError ts_bspline_copy(const tsBSpline *src, tsBSpline *dest,
899  tsStatus *status);
900 
911 void ts_bspline_move(tsBSpline *src, tsBSpline *dest);
912 
920 void ts_bspline_free(tsBSpline *spline);
921 
922 /* ------------------------------------------------------------------------- */
923 
931 
948  tsStatus *status);
949 
960 void ts_deboornet_move(tsDeBoorNet *src, tsDeBoorNet *dest);
961 
969 void ts_deboornet_free(tsDeBoorNet *net);
970 
971 
972 
973 /******************************************************************************
974 * *
975 * :: Interpolation and Approximation Functions *
976 * *
977 ******************************************************************************/
1017 tsError ts_bspline_interpolate_cubic_natural(const tsReal *points,
1018  size_t num_points, size_t dimension, tsBSpline *spline,
1019  tsStatus *status);
1020 
1070 tsError ts_bspline_interpolate_catmull_rom(const tsReal *points,
1071  size_t num_points, size_t dimension, tsReal alpha, const tsReal *first,
1072  const tsReal *last, tsReal epsilon, tsBSpline *spline,
1073  tsStatus *status);
1074 
1075 
1076 
1077 /******************************************************************************
1078 * *
1079 * :: Query Functions *
1080 * *
1081 ******************************************************************************/
1101 tsError ts_bspline_eval(const tsBSpline *spline, tsReal u, tsDeBoorNet *net,
1102  tsStatus *status);
1103 
1133 tsError ts_bspline_eval_all(const tsBSpline *spline, const tsReal *us,
1134  size_t num, tsReal **points, tsStatus *status);
1135 
1167 tsError ts_bspline_sample(const tsBSpline *spline, size_t num, tsReal **points,
1168  size_t *actual_num, tsStatus *status);
1169 
1225 tsError ts_bspline_bisect(const tsBSpline *spline, tsReal value,
1226  tsReal epsilon, int persnickety, size_t index, int ascending,
1227  size_t max_iter, tsDeBoorNet *net, tsStatus *status);
1228 
1239 void ts_bspline_domain(const tsBSpline *spline, tsReal *min, tsReal *max);
1240 
1259 tsError ts_bspline_is_closed(const tsBSpline *spline, tsReal epsilon,
1260  int *closed, tsStatus *status);
1261 
1262 
1263 
1264 /******************************************************************************
1265 * *
1266 * :: Transformation functions *
1267 * *
1268 * TinySpline is a library focusing on transformations. That is, most *
1269 * functions are used to transform splines by modifying their state, e.g., *
1270 * their number of control points, their degree, and so on. Accordingly, each *
1271 * transformation functions specifies an input and output parameter (along *
1272 * with the other parameters required to calculate the actual transformation). *
1273 * By passing a different pointer to the output parameter, the transformation *
1274 * result is calculated and stored without changing the state of the input. *
1275 * This is in particular useful when dealing with errors as the original state *
1276 * will never be modified. For instance, let's have a look at the following *
1277 * code snippet: *
1278 * *
1279 * tsBSpline in = ... // an arbitrary spline *
1280 * tsBSpline out; // result of transformation *
1281 * *
1282 * // Subdivide 'in' into sequence of bezier curves and store the result *
1283 * // in 'out'. Does not change 'in' in any way. *
1284 * tsError err = ts_bspline_to_beziers(&in, &out); *
1285 * if (err != TS_SUCCESS) { *
1286 * // fortunately, 'in' has not been changed *
1287 * } *
1288 * *
1289 * Even if 'ts_bspline_to_beziers' fails, the state of 'in' has not been *
1290 * changed allowing you to handle the error properly. *
1291 * *
1292 * Unless stated otherwise, the order of the parameters for transformation *
1293 * functions is: *
1294 * *
1295 * function(input, [additional_input], output, [additional_output]) *
1296 * *
1297 * 'additional_input' are parameters required to calculate the actual *
1298 * transformation. 'additional_output' are parameters storing further result. *
1299 * *
1300 * Note: None of TinySpline's transformation functions frees the memory of the *
1301 * output parameter. Thus, when using the same output parameter multiple *
1302 * times, make sure to free memory before each call. Otherwise, you will *
1303 * have a bad time with memory leaks: *
1304 * *
1305 * tsBSpline in = ... // an arbitrary spline *
1306 * tsBSpline out; // result of transformations *
1307 * *
1308 * ts_bspline_to_beziers(&in, &out); // first transformation *
1309 * ... // some code *
1310 * ts_bspline_free(&out); // avoid memory leak. *
1311 * ts_bspline_tension(&in, 0.85, &out); // next transformation *
1312 * *
1313 * If you want to modify your input directly without having a separate output, *
1314 * pass it as input and output at once: *
1315 * *
1316 * tsBSpline s = ... // an arbitrary spline *
1317 * tsReal *knots = ... // a knot vector *
1318 * *
1319 * ts_bspline_set_knots(&s, knots, &s); // copy 'knots' into 's' *
1320 * *
1321 * Note: If a transformation function fails *and* input != output, all fields *
1322 * of the output parameter are set to 0/NULL. If input == output, your *
1323 * input may have an invalid state in case of errors. *
1324 * *
1325 ******************************************************************************/
1375 tsError ts_bspline_derive(const tsBSpline *spline, size_t n, tsReal epsilon,
1376  tsBSpline *derivative, tsStatus *status);
1377 
1401 tsError ts_bspline_insert_knot(const tsBSpline *spline, tsReal u, size_t num,
1402  tsBSpline *result, size_t *k, tsStatus *status);
1403 
1427 tsError ts_bspline_split(const tsBSpline *spline, tsReal u, tsBSpline *split,
1428  size_t *k, tsStatus *status);
1429 
1459 tsError ts_bspline_tension(const tsBSpline *spline, tsReal tension,
1460  tsBSpline *out, tsStatus *status);
1461 
1478 tsError ts_bspline_to_beziers(const tsBSpline *spline, tsBSpline *beziers,
1479  tsStatus *status);
1480 
1481 
1482 
1483 /******************************************************************************
1484 * *
1485 * :: Serialization and Persistence Functions *
1486 * *
1487 * The following section contains functions to serialize and persist the data *
1488 * types listed above. *
1489 * *
1490 ******************************************************************************/
1506 tsError ts_bspline_to_json(const tsBSpline *spline, char **_json_,
1507  tsStatus *status);
1508 
1538 tsError ts_bspline_from_json(const char *json, tsBSpline *spline,
1539  tsStatus *status);
1540 
1557 tsError ts_bspline_save(const tsBSpline *spline, const char *path,
1558  tsStatus *status);
1559 
1591 tsError ts_bspline_load(const char *path, tsBSpline *spline, tsStatus *status);
1592 
1593 
1594 
1595 /******************************************************************************
1596 * *
1597 * :: Utility Functions *
1598 * *
1599 * The following section contains utility functions used by TinySpline which *
1600 * also may be helpful when using this library. *
1601 * *
1602 ******************************************************************************/
1617 int ts_knots_equal(tsReal x, tsReal y);
1618 
1630 void ts_arr_fill(tsReal *arr, size_t num, tsReal val);
1631 
1644 tsReal ts_distance(const tsReal *x, const tsReal *y, size_t dimension);
1645 
1646 
1647 
1648 #ifdef __cplusplus
1649 }
1650 #endif
1651 
1652 #endif /* TINYSPLINE_H */
1653 
tsError ts_bspline_load(const char *path, tsBSpline *spline, tsStatus *status)
Definition: tinyspline.c:2041
size_t ts_deboornet_len_points(const tsDeBoorNet *net)
Definition: tinyspline.c:387
tsError ts_bspline_eval_all(const tsBSpline *spline, const tsReal *us, size_t num, tsReal **points, tsStatus *status)
Definition: tinyspline.c:1190
struct tsDeBoorNetImpl * pImpl
Definition: tinyspline.h:374
size_t ts_bspline_order(const tsBSpline *spline)
Definition: tinyspline.c:169
tsError ts_deboornet_points(const tsDeBoorNet *net, tsReal **points, tsStatus *status)
Definition: tinyspline.c:402
Definition: tinyspline.h:116
tsError ts_bspline_to_beziers(const tsBSpline *spline, tsBSpline *beziers, tsStatus *status)
Definition: tinyspline.c:1697
tsError ts_bspline_interpolate_catmull_rom(const tsReal *points, size_t num_points, size_t dimension, tsReal alpha, const tsReal *first, const tsReal *last, tsReal epsilon, tsBSpline *spline, tsStatus *status)
Definition: tinyspline.c:880
size_t ts_bspline_sof_control_points(const tsBSpline *spline)
Definition: tinyspline.c:216
tsError ts_bspline_set_dimension(tsBSpline *spline, size_t dim, tsStatus *status)
Definition: tinyspline.c:190
tsError ts_bspline_set_knots(tsBSpline *spline, const tsReal *knots, tsStatus *status)
Definition: tinyspline.c:302
Definition: tinyspline.h:112
size_t ts_bspline_num_knots(const tsBSpline *spline)
Definition: tinyspline.c:275
size_t ts_bspline_degree(const tsBSpline *spline)
Definition: tinyspline.c:152
size_t ts_deboornet_num_points(const tsDeBoorNet *net)
Definition: tinyspline.c:392
tsError ts_bspline_knots(const tsBSpline *spline, tsReal **knots, tsStatus *status)
Definition: tinyspline.c:285
Definition: tinyspline.h:111
Definition: tinyspline.h:110
size_t k
Definition: tinyspline.c:52
size_t ts_deboornet_num_insertions(const tsDeBoorNet *net)
Definition: tinyspline.c:377
Definition: tinyspline.h:122
tsError ts_bspline_insert_knot(const tsBSpline *spline, tsReal u, size_t num, tsBSpline *result, size_t *k, tsStatus *status)
Definition: tinyspline.c:1621
Definition: tinyspline.h:109
Definition: tinyspline.h:309
void ts_arr_fill(tsReal *arr, size_t num, tsReal val)
Definition: tinyspline.c:2082
void ts_deboornet_move(tsDeBoorNet *src, tsDeBoorNet *dest)
Definition: tinyspline.c:637
size_t ts_deboornet_dimension(const tsDeBoorNet *net)
Definition: tinyspline.c:382
size_t dim
Definition: tinyspline.c:55
tsError ts_bspline_copy(const tsBSpline *src, tsBSpline *dest, tsStatus *status)
Definition: tinyspline.c:548
Definition: tinyspline.h:128
Definition: tinyspline.h:121
void ts_bspline_domain(const tsBSpline *spline, tsReal *min, tsReal *max)
Definition: tinyspline.c:1314
tsError ts_bspline_control_points(const tsBSpline *spline, tsReal **ctrlp, tsStatus *status)
Definition: tinyspline.c:221
tsError ts_bspline_split(const tsBSpline *spline, tsReal u, tsBSpline *split, size_t *k, tsStatus *status)
Definition: tinyspline.c:1642
tsDeBoorNet ts_deboornet_init()
Definition: tinyspline.c:580
tsError ts_bspline_set_knot_at(tsBSpline *spline, size_t index, tsReal knot, tsStatus *status)
Definition: tinyspline.c:335
tsError ts_bspline_set_control_point_at(tsBSpline *spline, size_t index, const tsReal *ctrlp, tsStatus *status)
Definition: tinyspline.c:261
tsError ts_bspline_knot_at(const tsBSpline *spline, size_t index, tsReal *knot, tsStatus *status)
Definition: tinyspline.c:296
tsError ts_bspline_interpolate_cubic_natural(const tsReal *points, size_t num_points, size_t dimension, tsBSpline *spline, tsStatus *status)
Definition: tinyspline.c:795
size_t ts_bspline_dimension(const tsBSpline *spline)
Definition: tinyspline.c:185
tsError ts_bspline_set_degree(tsBSpline *spline, size_t deg, tsStatus *status)
Definition: tinyspline.c:157
tsError ts_bspline_set_order(tsBSpline *spline, size_t order, tsStatus *status)
Definition: tinyspline.c:174
tsError ts_bspline_eval(const tsBSpline *spline, tsReal u, tsDeBoorNet *net, tsStatus *status)
Definition: tinyspline.c:1175
size_t ts_deboornet_index(const tsDeBoorNet *net)
Definition: tinyspline.c:367
tsError ts_bspline_tension(const tsBSpline *spline, tsReal tension, tsBSpline *out, tsStatus *status)
Definition: tinyspline.c:1671
tsBSpline ts_bspline_init()
Definition: tinyspline.c:446
Definition: tinyspline.h:119
Definition: tinyspline.h:114
tsReal u
Definition: tinyspline.c:51
tsError ts_bspline_bisect(const tsBSpline *spline, tsReal value, tsReal epsilon, int persnickety, size_t index, int ascending, size_t max_iter, tsDeBoorNet *net, tsStatus *status)
Definition: tinyspline.c:1257
Definition: tinyspline.h:372
tsError ts_bspline_to_json(const tsBSpline *spline, char **_json_, tsStatus *status)
Definition: tinyspline.c:1993
Definition: tinyspline.h:113
void ts_deboornet_free(tsDeBoorNet *net)
Definition: tinyspline.c:615
Definition: tinyspline.h:117
tsError ts_bspline_control_point_at(const tsBSpline *spline, size_t index, tsReal **ctrlp, tsStatus *status)
Definition: tinyspline.c:232
tsReal ts_distance(const tsReal *x, const tsReal *y, size_t dimension)
Definition: tinyspline.c:2089
int ts_knots_equal(tsReal x, tsReal y)
Definition: tinyspline.c:2077
size_t ts_bspline_sof_knots(const tsBSpline *spline)
Definition: tinyspline.c:280
void ts_bspline_move(tsBSpline *src, tsBSpline *dest)
Definition: tinyspline.c:563
Definition: tinyspline.h:108
size_t ts_deboornet_sof_result(const tsDeBoorNet *net)
Definition: tinyspline.c:423
Definition: tinyspline.h:120
Definition: tinyspline.c:38
tsError ts_bspline_derive(const tsBSpline *spline, size_t n, tsReal epsilon, tsBSpline *derivative, tsStatus *status)
Definition: tinyspline.c:1423
tsError ts_bspline_new(size_t num_control_points, size_t dimension, size_t degree, tsBSplineType type, tsBSpline *spline, tsStatus *status)
Definition: tinyspline.c:500
tsError ts_deboornet_copy(const tsDeBoorNet *src, tsDeBoorNet *dest, tsStatus *status)
Definition: tinyspline.c:622
size_t ts_bspline_num_control_points(const tsBSpline *spline)
Definition: tinyspline.c:211
size_t ts_deboornet_len_result(const tsDeBoorNet *net)
Definition: tinyspline.c:413
tsError ts_bspline_set_control_points(tsBSpline *spline, const tsReal *ctrlp, tsStatus *status)
Definition: tinyspline.c:253
tsError ts_bspline_from_json(const char *json, tsBSpline *spline, tsStatus *status)
Definition: tinyspline.c:2007
struct tsBSplineImpl * pImpl
Definition: tinyspline.h:311
tsError ts_bspline_is_closed(const tsBSpline *spline, tsReal epsilon, int *closed, tsStatus *status)
Definition: tinyspline.c:1322
Definition: tinyspline.c:49
size_t ts_deboornet_sof_points(const tsDeBoorNet *net)
Definition: tinyspline.c:397
size_t ts_deboornet_num_result(const tsDeBoorNet *net)
Definition: tinyspline.c:418
tsError code
Definition: tinyspline.h:129
Definition: tinyspline.h:118
Definition: tinyspline.h:115
tsError
Definition: tinyspline.h:107
tsError ts_bspline_save(const tsBSpline *spline, const char *path, tsStatus *status)
Definition: tinyspline.c:2027
tsReal ts_deboornet_knot(const tsDeBoorNet *net)
Definition: tinyspline.c:362
void ts_bspline_free(tsBSpline *spline)
Definition: tinyspline.c:571
tsBSplineType
Definition: tinyspline.h:271
size_t ts_deboornet_multiplicity(const tsDeBoorNet *net)
Definition: tinyspline.c:372
tsError ts_deboornet_result(const tsDeBoorNet *net, tsReal **result, tsStatus *status)
Definition: tinyspline.c:428
size_t ts_bspline_len_control_points(const tsBSpline *spline)
Definition: tinyspline.c:205
tsError ts_bspline_sample(const tsBSpline *spline, size_t num, tsReal **points, size_t *actual_num, tsStatus *status)
Definition: tinyspline.c:1223