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 
29 #define TS_MIN_KNOT_VALUE 0.0f
30 
34 #define TS_MAX_KNOT_VALUE 1.0f
35 
39 #define TS_KNOT_EPSILON 1e-4
40 
47 #define TS_CONTROL_POINT_EPSILON 1e-6
48 
49 
50 
51 /******************************************************************************
52 * *
53 * :: API Configuration *
54 * *
55 ******************************************************************************/
56 #ifdef TINYSPLINE_FLOAT_PRECISION
57 typedef float tsReal;
58 #else
59 typedef double tsReal;
60 #endif
61 
62 
63 
64 /******************************************************************************
65 * *
66 * :: Error Handling *
67 * *
68 * The following enums, structs, and macros are used to define and handle *
69 * different types of errors. Use them as follows: *
70 * *
71 * tsStatus status; *
72 * TS_TRY(any_label, status.code, &status) *
73 * // Wrap function calls with TS_CALL. *
74 * TS_CALL(any_label, status.code, ts_bspline_to_beziers( *
75 * &spline, &beziers, &status)) *
76 * if (...) *
77 * // Use one of the TS_THROW macros to raise an error. *
78 * TS_THROW_0(any_label, &status, TS_MALLOC, "out of memory") *
79 * TS_CATCH(status.code) *
80 * // Executed on error. *
81 * printf(status.message); *
82 * TS_FINALLY *
83 * // Executed in any case. *
84 * TS_END_TRY *
85 * *
86 * Although it is always advisable to properly handle errors, embedding your *
87 * code into a TS_TRY/TS_END_TRY block as well as passing a pointer to a *
88 * tsStatus object is entirely optional: *
89 * *
90 * ts_bspline_to_beziers(&spline, &beziers, NULL); *
91 * *
92 * Yet, you may check if a particular function failed, albeit you don't have *
93 * access to the error message: *
94 * *
95 * if (ts_bspline_to_beziers(&spline, &beziers, NULL)) *
96 * // an error occurred *
97 * *
98 ******************************************************************************/
102 typedef enum {
104  TS_MALLOC = -1,
105  TS_DIM_ZERO = -2,
113  TS_IO_ERROR = -11,
117 } tsError;
118 
122 typedef struct {
124  char message[100];
125 } tsStatus;
126 
127 #define TS_TRY(label, error, status) \
128 { \
129  (error) = TS_SUCCESS; \
130  if ((status) != NULL) { \
131  (status)->code = TS_SUCCESS; \
132  (status)->message[0] = '\0'; \
133  } \
134  __ ## label ## __: \
135  if (!(error)) {
136 
137 #define TS_CALL(label, error, call) \
138  (error) = (call); \
139  if ((error)) goto __ ## label ## __;
140 
141 #define TS_CATCH(error) \
142  } if ((error)) {
143 
144 #define TS_FINALLY \
145  } {
146 
147 #define TS_END_TRY \
148  } \
149 }
150 
151 #define TS_END_TRY_RETURN(error) \
152  TS_END_TRY return (error);
153 
154 
155 #define TS_CALL_ROE(error, call) \
156 { \
157  (error) = (call); \
158  if ((error)) return error; \
159 }
160 
161 
162 #define TS_RETURN_SUCCESS(status) \
163 { \
164  if ((status) != NULL) { \
165  (status)->code = TS_SUCCESS; \
166  (status)->message[0] = '\0'; \
167  } \
168  return TS_SUCCESS; \
169 }
170 
171 #define TS_RETURN_0(status, error, msg) \
172 { \
173  if ((status) != NULL) { \
174  (status)->code = error; \
175  sprintf((status)->message, msg); \
176  } \
177  return error; \
178 }
179 
180 #define TS_RETURN_1(status, error, msg, arg1) \
181 { \
182  if ((status) != NULL) { \
183  (status)->code = error; \
184  sprintf((status)->message, msg, arg1); \
185  } \
186  return error; \
187 }
188 
189 #define TS_RETURN_2(status, error, msg, arg1, arg2) \
190 { \
191  if ((status) != NULL) { \
192  (status)->code = error; \
193  sprintf((status)->message, msg, arg1, arg2); \
194  } \
195  return error; \
196 }
197 
198 #define TS_RETURN_3(status, error, msg, arg1, arg2, arg3) \
199 { \
200  if ((status) != NULL) { \
201  (status)->code = error; \
202  sprintf((status)->message, msg, arg1, arg2, arg3); \
203  } \
204  return error; \
205 }
206 
207 #define TS_THROW_0(label, error, status, val, msg) \
208 { \
209  (error) = val; \
210  if ((status) != NULL) { \
211  (status)->code = val; \
212  sprintf((status)->message, msg); \
213  } \
214  goto __ ## label ## __; \
215 }
216 
217 #define TS_THROW_1(label, error, status, val, msg, arg1) \
218 { \
219  (error) = val; \
220  if ((status) != NULL) { \
221  (status)->code = val; \
222  sprintf((status)->message, msg, arg1); \
223  } \
224  goto __ ## label ## __; \
225 }
226 
227 #define TS_THROW_2(label, error, status, val, msg, arg1, arg2) \
228 { \
229  (error) = val; \
230  if ((status) != NULL) { \
231  (status)->code = val; \
232  sprintf((status)->message, msg, arg1, arg2); \
233  } \
234  goto __ ## label ## __; \
235 }
236 
237 #define TS_THROW_3(label, error, status, val, msg, arg1, arg2, arg3) \
238 { \
239  (error) = val; \
240  if ((status) != NULL) { \
241  (status)->code = val; \
242  sprintf((status)->message, msg, arg1, arg2, arg3); \
243  } \
244  goto __ ## label ## __; \
245 }
246 
247 
248 
249 /******************************************************************************
250 * *
251 * :: Data Types *
252 * *
253 * Using the PIMPL design pattern, the internal fields of the data types are *
254 * encapsulated and can only be accessed by calling the corresponding field *
255 * access functions. *
256 * *
257 ******************************************************************************/
264 typedef enum
265 {
266  /* Uniformly spaced knot vector. */
267  TS_OPENED = 0,
268 
269  /* Uniformly spaced knot vector with clamped end knots. */
270  TS_CLAMPED = 1,
271 
272  /* Uniformly spaced knot vector with s(u) = order of spline. */
273  TS_BEZIERS = 2
274 } tsBSplineType;
275 
302 typedef struct
303 {
305 } tsBSpline;
306 
365 typedef struct
366 {
368 } tsDeBoorNet;
369 
370 
371 
372 /******************************************************************************
373 * *
374 * :: Field Access Functions *
375 * *
376 ******************************************************************************/
385 size_t ts_bspline_degree(const tsBSpline *spline);
386 
401 tsError ts_bspline_set_degree(tsBSpline *spline, size_t deg, tsStatus *status);
402 
411 size_t ts_bspline_order(const tsBSpline *spline);
412 
429 tsError ts_bspline_set_order(tsBSpline *spline, size_t order,
430  tsStatus *status);
431 
443 size_t ts_bspline_dimension(const tsBSpline *spline);
444 
470  tsStatus *status);
471 
480 size_t ts_bspline_len_control_points(const tsBSpline *spline);
481 
490 size_t ts_bspline_num_control_points(const tsBSpline *spline);
491 
501 size_t ts_bspline_sof_control_points(const tsBSpline *spline);
502 
517 tsError ts_bspline_control_points(const tsBSpline *spline, tsReal **ctrlp,
518  tsStatus *status);
519 
538 tsError ts_bspline_control_point_at(const tsBSpline *spline, size_t index,
539  tsReal **ctrlp, tsStatus *status);
540 
553 tsError ts_bspline_set_control_points(tsBSpline *spline, const tsReal *ctrlp,
554  tsStatus *status);
555 
574  const tsReal *ctrlp, tsStatus *status);
575 
584 size_t ts_bspline_num_knots(const tsBSpline *spline);
585 
595 size_t ts_bspline_sof_knots(const tsBSpline *spline);
596 
611 tsError ts_bspline_knots(const tsBSpline *spline, tsReal **knots,
612  tsStatus *status);
613 
630 tsError ts_bspline_knot_at(const tsBSpline *spline, size_t index, tsReal *knot,
631  tsStatus *status);
632 
649 tsError ts_bspline_set_knots(tsBSpline *spline, const tsReal *knots,
650  tsStatus *status);
651 
673 tsError ts_bspline_set_knot_at(tsBSpline *spline, size_t index, tsReal knot,
674  tsStatus *status);
675 
676 /* ------------------------------------------------------------------------- */
677 
686 tsReal ts_deboornet_knot(const tsDeBoorNet *net);
687 
696 size_t ts_deboornet_index(const tsDeBoorNet *net);
697 
706 size_t ts_deboornet_multiplicity(const tsDeBoorNet *net);
707 
718 size_t ts_deboornet_num_insertions(const tsDeBoorNet *net);
719 
731 size_t ts_deboornet_dimension(const tsDeBoorNet *net);
732 
741 size_t ts_deboornet_len_points(const tsDeBoorNet *net);
742 
751 size_t ts_deboornet_num_points(const tsDeBoorNet *net);
752 
762 size_t ts_deboornet_sof_points(const tsDeBoorNet *net);
763 
778 tsError ts_deboornet_points(const tsDeBoorNet *net, tsReal **points,
779  tsStatus *status);
780 
789 size_t ts_deboornet_len_result(const tsDeBoorNet *net);
790 
800 size_t ts_deboornet_num_result(const tsDeBoorNet *net);
801 
811 size_t ts_deboornet_sof_result(const tsDeBoorNet *net);
812 
827 tsError ts_deboornet_result(const tsDeBoorNet *net, tsReal **result,
828  tsStatus *status);
829 
830 
831 
832 /******************************************************************************
833 * *
834 * :: Constructors, Destructors, Copy, and Move Functions *
835 * *
836 ******************************************************************************/
844 
872 tsError ts_bspline_new(size_t num_control_points, size_t dimension,
873  size_t degree, tsBSplineType type, tsBSpline *spline,
874  tsStatus *status);
875 
891 tsError ts_bspline_copy(const tsBSpline *src, tsBSpline *dest,
892  tsStatus *status);
893 
904 void ts_bspline_move(tsBSpline *src, tsBSpline *dest);
905 
913 void ts_bspline_free(tsBSpline *spline);
914 
915 /* ------------------------------------------------------------------------- */
916 
924 
941  tsStatus *status);
942 
953 void ts_deboornet_move(tsDeBoorNet *src, tsDeBoorNet *dest);
954 
962 void ts_deboornet_free(tsDeBoorNet *net);
963 
964 
965 
966 /******************************************************************************
967 * *
968 * :: Interpolation and Approximation Functions *
969 * *
970 ******************************************************************************/
1010 tsError ts_bspline_interpolate_cubic(const tsReal *points, size_t num_points,
1011  size_t dimension, tsBSpline *spline, tsStatus *status);
1012 
1013 
1014 
1015 /******************************************************************************
1016 * *
1017 * :: Query Functions *
1018 * *
1019 ******************************************************************************/
1039 tsError ts_bspline_eval(const tsBSpline *spline, tsReal u, tsDeBoorNet *net,
1040  tsStatus *status);
1041 
1071 tsError ts_bspline_eval_all(const tsBSpline *spline, const tsReal *us,
1072  size_t num, tsReal **points, tsStatus *status);
1073 
1105 tsError ts_bspline_sample(const tsBSpline *spline, size_t num, tsReal **points,
1106  size_t *actual_num, tsStatus *status);
1107 
1163 tsError ts_bspline_bisect(const tsBSpline *spline, tsReal value,
1164  tsReal epsilon, int persnickety, size_t index, int ascending,
1165  size_t max_iter, tsDeBoorNet *net, tsStatus *status);
1166 
1177 void ts_bspline_domain(const tsBSpline *spline, tsReal *min, tsReal *max);
1178 
1199 tsError ts_bspline_is_closed(const tsBSpline *spline, tsReal epsilon,
1200  int *closed, tsStatus *status);
1201 
1202 
1203 
1204 /******************************************************************************
1205 * *
1206 * :: Transformation functions *
1207 * *
1208 * TinySpline is a library focusing on transformations. That is, most *
1209 * functions are used to transform splines by modifying their state, e.g., *
1210 * their number of control points, their degree, and so on. Accordingly, each *
1211 * transformation functions specifies an input and output parameter (along *
1212 * with the other parameters required to calculate the actual transformation). *
1213 * By passing a different pointer to the output parameter, the transformation *
1214 * result is calculated and stored without changing the state of the input. *
1215 * This is in particular useful when dealing with errors as the original state *
1216 * will never be modified. For instance, let's have a look at the following *
1217 * code snippet: *
1218 * *
1219 * tsBSpline in = ... // an arbitrary spline *
1220 * tsBSpline out; // result of transformation *
1221 * *
1222 * // Subdivide 'in' into sequence of bezier curves and store the result *
1223 * // in 'out'. Does not change 'in' in any way. *
1224 * tsError err = ts_bspline_to_beziers(&in, &out); *
1225 * if (err != TS_SUCCESS) { *
1226 * // fortunately, 'in' has not been changed *
1227 * } *
1228 * *
1229 * Even if 'ts_bspline_to_beziers' fails, the state of 'in' has not been *
1230 * changed allowing you to handle the error properly. *
1231 * *
1232 * Unless stated otherwise, the order of the parameters for transformation *
1233 * functions is: *
1234 * *
1235 * function(input, [additional_input], output, [additional_output]) *
1236 * *
1237 * 'additional_input' are parameters required to calculate the actual *
1238 * transformation. 'additional_output' are parameters storing further result. *
1239 * *
1240 * Note: None of TinySpline's transformation functions frees the memory of the *
1241 * output parameter. Thus, when using the same output parameter multiple *
1242 * times, make sure to free memory before each call. Otherwise, you will *
1243 * have a bad time with memory leaks: *
1244 * *
1245 * tsBSpline in = ... // an arbitrary spline *
1246 * tsBSpline out; // result of transformations *
1247 * *
1248 * ts_bspline_to_beziers(&in, &out); // first transformation *
1249 * ... // some code *
1250 * ts_bspline_free(&out); // avoid memory leak. *
1251 * ts_bspline_tension(&in, 0.85, &out); // next transformation *
1252 * *
1253 * If you want to modify your input directly without having a separate output, *
1254 * pass it as input and output at once: *
1255 * *
1256 * tsBSpline s = ... // an arbitrary spline *
1257 * tsReal *knots = ... // a knot vector *
1258 * *
1259 * ts_bspline_set_knots(&s, knots, &s); // copy 'knots' into 's' *
1260 * *
1261 * Note: If a transformation function fails *and* input != output, all fields *
1262 * of the output parameter are set to 0/NULL. If input == output, your *
1263 * input may have an invalid state in case of errors. *
1264 * *
1265 ******************************************************************************/
1315 tsError ts_bspline_derive(const tsBSpline *spline, size_t n, tsReal epsilon,
1316  tsBSpline *derivative, tsStatus *status);
1317 
1341 tsError ts_bspline_insert_knot(const tsBSpline *spline, tsReal u, size_t num,
1342  tsBSpline *result, size_t *k, tsStatus *status);
1343 
1367 tsError ts_bspline_split(const tsBSpline *spline, tsReal u, tsBSpline *split,
1368  size_t *k, tsStatus *status);
1369 
1399 tsError ts_bspline_tension(const tsBSpline *spline, tsReal tension,
1400  tsBSpline *out, tsStatus *status);
1401 
1418 tsError ts_bspline_to_beziers(const tsBSpline *spline, tsBSpline *beziers,
1419  tsStatus *status);
1420 
1421 
1422 
1423 /******************************************************************************
1424 * *
1425 * :: Serialization and Persistence Functions *
1426 * *
1427 * The following section contains functions to serialize and persist the data *
1428 * types listed above. *
1429 * *
1430 ******************************************************************************/
1446 tsError ts_bspline_to_json(const tsBSpline *spline, char **_json_,
1447  tsStatus *status);
1448 
1478 tsError ts_bspline_from_json(const char *json, tsBSpline *spline,
1479  tsStatus *status);
1480 
1497 tsError ts_bspline_save_json(const tsBSpline *spline, const char *path,
1498  tsStatus *status);
1499 
1531 tsError ts_bspline_load_json(const char *path, tsBSpline *spline,
1532  tsStatus *status);
1533 
1534 
1535 
1536 /******************************************************************************
1537 * *
1538 * :: Utility Functions *
1539 * *
1540 * The following section contains utility functions used by TinySpline which *
1541 * also may be helpful when using this library. *
1542 * *
1543 ******************************************************************************/
1558 int ts_knots_equal(tsReal x, tsReal y);
1559 
1571 void ts_arr_fill(tsReal *arr, size_t num, tsReal val);
1572 
1585 tsReal ts_distance(const tsReal *x, const tsReal *y, size_t dimension);
1586 
1587 
1588 
1589 #ifdef __cplusplus
1590 }
1591 #endif
1592 
1593 #endif /* TINYSPLINE_H */
1594 
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:992
struct tsDeBoorNetImpl * pImpl
Definition: tinyspline.h:367
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:111
tsError ts_bspline_to_beziers(const tsBSpline *spline, tsBSpline *beziers, tsStatus *status)
Definition: tinyspline.c:1486
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:107
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:106
Definition: tinyspline.h:105
size_t k
Definition: tinyspline.c:52
size_t ts_deboornet_num_insertions(const tsDeBoorNet *net)
Definition: tinyspline.c:377
tsError ts_bspline_insert_knot(const tsBSpline *spline, tsReal u, size_t num, tsBSpline *result, size_t *k, tsStatus *status)
Definition: tinyspline.c:1410
Definition: tinyspline.h:104
Definition: tinyspline.h:302
tsError ts_bspline_load_json(const char *path, tsBSpline *spline, tsStatus *status)
Definition: tinyspline.c:1830
void ts_arr_fill(tsReal *arr, size_t num, tsReal val)
Definition: tinyspline.c:1872
void ts_deboornet_move(tsDeBoorNet *src, tsDeBoorNet *dest)
Definition: tinyspline.c:637
size_t ts_deboornet_dimension(const tsDeBoorNet *net)
Definition: tinyspline.c:382
tsError ts_bspline_interpolate_cubic(const tsReal *points, size_t num_points, size_t dimension, tsBSpline *spline, tsStatus *status)
Definition: tinyspline.c:803
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:122
Definition: tinyspline.h:116
void ts_bspline_domain(const tsBSpline *spline, tsReal *min, tsReal *max)
Definition: tinyspline.c:1116
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:1431
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_save_json(const tsBSpline *spline, const char *path, tsStatus *status)
Definition: tinyspline.c:1816
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
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:977
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:1460
tsBSpline ts_bspline_init()
Definition: tinyspline.c:446
Definition: tinyspline.h:114
Definition: tinyspline.h:109
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:1059
Definition: tinyspline.h:365
tsError ts_bspline_to_json(const tsBSpline *spline, char **_json_, tsStatus *status)
Definition: tinyspline.c:1782
Definition: tinyspline.h:108
void ts_deboornet_free(tsDeBoorNet *net)
Definition: tinyspline.c:615
Definition: tinyspline.h:112
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:1879
int ts_knots_equal(tsReal x, tsReal y)
Definition: tinyspline.c:1867
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:103
size_t ts_deboornet_sof_result(const tsDeBoorNet *net)
Definition: tinyspline.c:423
Definition: tinyspline.h:115
Definition: tinyspline.c:38
tsError ts_bspline_derive(const tsBSpline *spline, size_t n, tsReal epsilon, tsBSpline *derivative, tsStatus *status)
Definition: tinyspline.c:1206
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:1796
struct tsBSplineImpl * pImpl
Definition: tinyspline.h:304
tsError ts_bspline_is_closed(const tsBSpline *spline, tsReal epsilon, int *closed, tsStatus *status)
Definition: tinyspline.c:1124
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:123
Definition: tinyspline.h:113
Definition: tinyspline.h:110
tsError
Definition: tinyspline.h:102
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:264
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:1025