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. Otherwise, the *
17 * internal consistency can not be guaranteed anymore. The predefined values *
18 * should be suitable for almost all environments, though. *
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 
41 
42 
43 /******************************************************************************
44 * *
45 * :: System Dependent Configuration *
46 * *
47 * The following configuration values must be adapted to your system. Some of *
48 * them may be configured with preprocessor definitions. The default values *
49 * should be fine for most modern hardware, such as x86, x86_64, and arm. *
50 * *
51 ******************************************************************************/
52 #ifdef TINYSPLINE_FLOAT_PRECISION
53 typedef float tsReal;
54 #else
55 typedef double tsReal;
56 #endif
57 
58 
59 
60 /******************************************************************************
61 * *
62 * :: Error Handling *
63 * *
64 * The following section defines enums, structs, and macros that are used to *
65 * handle different types of errors. The following listing shows an example: *
66 * *
67 * tsStatus status; *
68 * TS_TRY(any_label, status.code, &status) *
69 * // Use TS_CALL when calling functions of this library. *
70 * TS_CALL(any_label, status.code, ts_bspline_to_beziers( *
71 * &spline, &beziers, &status)) *
72 * if (...) *
73 * // Use one of the TS_THROW macros to raise an error. *
74 * TS_THROW_0(any_label, &status, TS_MALLOC, "out of memory") *
75 * TS_CATCH(status.code) *
76 * // Executed on error. *
77 * printf(status.message); *
78 * TS_FINALLY *
79 * // Executed in any case. *
80 * TS_END_TRY *
81 * *
82 * Although it is always advisable to properly handle errors, embedding your *
83 * code into TS_TRY/TS_END_TRY as well as passing a pointer to a tsStatus *
84 * object is entirely optional, as shown by the following example: *
85 * *
86 * ts_bspline_to_beziers(&spline, &beziers, NULL); *
87 * *
88 * Yet, you may check if a particular function failed, albeit you don't have *
89 * access to the error message: *
90 * *
91 * if (ts_bspline_to_beziers(&spline, &beziers, NULL)) *
92 * // an error occurred *
93 * *
94 ******************************************************************************/
98 typedef enum {
99  TS_SUCCESS = 0,
100  TS_MALLOC = -1,
101  TS_DIM_ZERO = -2,
109  TS_IO_ERROR = -11,
113 } tsError;
114 
118 typedef struct {
120  char message[100];
121 } tsStatus;
122 
123 #define TS_TRY(label, error, status) \
124 { \
125  (error) = TS_SUCCESS; \
126  if ((status) != NULL) { \
127  (status)->code = TS_SUCCESS; \
128  (status)->message[0] = '\0'; \
129  } \
130  __ ## label ## __: \
131  if (!(error)) {
132 
133 #define TS_CALL(label, error, call) \
134  (error) = (call); \
135  if ((error)) goto __ ## label ## __;
136 
137 #define TS_CATCH(error) \
138  } if ((error)) {
139 
140 #define TS_FINALLY \
141  } {
142 
143 #define TS_END_TRY \
144  } \
145 }
146 
147 #define TS_END_TRY_RETURN(error) \
148  TS_END_TRY return (error);
149 
150 
151 #define TS_CALL_ROE(error, call) \
152 { \
153  (error) = (call); \
154  if ((error)) return error; \
155 }
156 
157 
158 #define TS_RETURN_SUCCESS(status) \
159 { \
160  if ((status) != NULL) { \
161  (status)->code = TS_SUCCESS; \
162  (status)->message[0] = '\0'; \
163  } \
164  return TS_SUCCESS; \
165 }
166 
167 #define TS_RETURN_0(status, error, msg) \
168 { \
169  if ((status) != NULL) { \
170  (status)->code = error; \
171  sprintf((status)->message, msg); \
172  } \
173  return error; \
174 }
175 
176 #define TS_RETURN_1(status, error, msg, arg1) \
177 { \
178  if ((status) != NULL) { \
179  (status)->code = error; \
180  sprintf((status)->message, msg, arg1); \
181  } \
182  return error; \
183 }
184 
185 #define TS_RETURN_2(status, error, msg, arg1, arg2) \
186 { \
187  if ((status) != NULL) { \
188  (status)->code = error; \
189  sprintf((status)->message, msg, arg1, arg2); \
190  } \
191  return error; \
192 }
193 
194 #define TS_RETURN_3(status, error, msg, arg1, arg2, arg3) \
195 { \
196  if ((status) != NULL) { \
197  (status)->code = error; \
198  sprintf((status)->message, msg, arg1, arg2, arg3); \
199  } \
200  return error; \
201 }
202 
203 #define TS_THROW_0(label, error, status, val, msg) \
204 { \
205  (error) = val; \
206  if ((status) != NULL) { \
207  (status)->code = val; \
208  sprintf((status)->message, msg); \
209  } \
210  goto __ ## label ## __; \
211 }
212 
213 #define TS_THROW_1(label, error, status, val, msg, arg1) \
214 { \
215  (error) = val; \
216  if ((status) != NULL) { \
217  (status)->code = val; \
218  sprintf((status)->message, msg, arg1); \
219  } \
220  goto __ ## label ## __; \
221 }
222 
223 #define TS_THROW_2(label, error, status, val, msg, arg1, arg2) \
224 { \
225  (error) = val; \
226  if ((status) != NULL) { \
227  (status)->code = val; \
228  sprintf((status)->message, msg, arg1, arg2); \
229  } \
230  goto __ ## label ## __; \
231 }
232 
233 #define TS_THROW_3(label, error, status, val, msg, arg1, arg2, arg3) \
234 { \
235  (error) = val; \
236  if ((status) != NULL) { \
237  (status)->code = val; \
238  sprintf((status)->message, msg, arg1, arg2, arg3); \
239  } \
240  goto __ ## label ## __; \
241 }
242 
243 
244 
245 /******************************************************************************
246 * *
247 * :: Data Types *
248 * *
249 * The following section defines all available data types. *
250 * *
251 ******************************************************************************/
258 typedef enum
259 {
260  /* Uniformly spaced knot vector. */
261  TS_OPENED = 0,
262 
263  /* Uniformly spaced knot vector with clamped end knots. */
264  TS_CLAMPED = 1,
265 
266  /* Uniformly spaced knot vector with s(u) = order of spline. */
267  TS_BEZIERS = 2
268 } tsBSplineType;
269 
296 typedef struct
297 {
299 } tsBSpline;
300 
383 typedef struct
384 {
386 } tsDeBoorNet;
387 
388 
389 
390 /******************************************************************************
391 * *
392 * :: Field Access Functions *
393 * *
394 * The following section contains getter and setter functions for the internal *
395 * state of the structs listed above. *
396 * *
397 ******************************************************************************/
406 size_t ts_bspline_degree(const tsBSpline *spline);
407 
422 tsError ts_bspline_set_degree(tsBSpline *spline, size_t deg, tsStatus *status);
423 
432 size_t ts_bspline_order(const tsBSpline *spline);
433 
450 tsError ts_bspline_set_order(tsBSpline *spline, size_t order,
451  tsStatus *status);
452 
464 size_t ts_bspline_dimension(const tsBSpline *spline);
465 
491  tsStatus *status);
492 
501 size_t ts_bspline_len_control_points(const tsBSpline *spline);
502 
511 size_t ts_bspline_num_control_points(const tsBSpline *spline);
512 
522 size_t ts_bspline_sof_control_points(const tsBSpline *spline);
523 
538 tsError ts_bspline_control_points(const tsBSpline *spline, tsReal **ctrlp,
539  tsStatus *status);
540 
560 tsError ts_bspline_control_point_at(const tsBSpline *spline, size_t index,
561  tsReal **ctrlp, tsStatus *status);
562 
575 tsError ts_bspline_set_control_points(tsBSpline *spline, const tsReal *ctrlp,
576  tsStatus *status);
577 
596  const tsReal *ctrlp, tsStatus *status);
597 
606 size_t ts_bspline_num_knots(const tsBSpline *spline);
607 
617 size_t ts_bspline_sof_knots(const tsBSpline *spline);
618 
633 tsError ts_bspline_knots(const tsBSpline *spline, tsReal **knots,
634  tsStatus *status);
635 
652 tsError ts_bspline_set_knots(tsBSpline *spline, const tsReal *knots,
653  tsStatus *status);
654 
655 /* ------------------------------------------------------------------------- */
656 
665 tsReal ts_deboornet_knot(const tsDeBoorNet *net);
666 
675 size_t ts_deboornet_index(const tsDeBoorNet *net);
676 
685 size_t ts_deboornet_multiplicity(const tsDeBoorNet *net);
686 
697 size_t ts_deboornet_num_insertions(const tsDeBoorNet *net);
698 
710 size_t ts_deboornet_dimension(const tsDeBoorNet *net);
711 
720 size_t ts_deboornet_len_points(const tsDeBoorNet *net);
721 
730 size_t ts_deboornet_num_points(const tsDeBoorNet *net);
731 
741 size_t ts_deboornet_sof_points(const tsDeBoorNet *net);
742 
757 tsError ts_deboornet_points(const tsDeBoorNet *net, tsReal **points,
758  tsStatus *status);
759 
768 size_t ts_deboornet_len_result(const tsDeBoorNet *net);
769 
779 size_t ts_deboornet_num_result(const tsDeBoorNet *net);
780 
790 size_t ts_deboornet_sof_result(const tsDeBoorNet *net);
791 
806 tsError ts_deboornet_result(const tsDeBoorNet *net, tsReal **result,
807  tsStatus *status);
808 
809 
810 
811 /******************************************************************************
812 * *
813 * :: Constructors, Destructors, Copy, and Move Functions *
814 * *
815 * The following section contains functions to create and delete instances of *
816 * the data types listed above. Additionally, each data type has a copy and *
817 * move function. *
818 * *
819 ******************************************************************************/
827 
855 tsError ts_bspline_new(size_t num_control_points, size_t dimension,
856  size_t degree, tsBSplineType type, tsBSpline *spline,
857  tsStatus *status);
858 
874 tsError ts_bspline_copy(const tsBSpline *src, tsBSpline *dest,
875  tsStatus *status);
876 
887 void ts_bspline_move(tsBSpline *src, tsBSpline *dest);
888 
896 void ts_bspline_free(tsBSpline *spline);
897 
898 /* ------------------------------------------------------------------------- */
899 
907 
924  tsStatus *status);
925 
936 void ts_deboornet_move(tsDeBoorNet *src, tsDeBoorNet *dest);
937 
945 void ts_deboornet_free(tsDeBoorNet *net);
946 
947 
948 
949 /******************************************************************************
950 * *
951 * :: Interpolation and Approximation Functions *
952 * *
953 * The following section contains functions to interpolate and approximate *
954 * arbitrary splines. *
955 * *
956 ******************************************************************************/
997 tsError ts_bspline_interpolate_cubic(const tsReal *points, size_t n,
998  size_t dim, tsBSpline *_spline_, tsStatus *status);
999 
1000 
1001 
1002 /******************************************************************************
1003 * *
1004 * :: Query Functions *
1005 * *
1006 * The following section contains functions to query splines. *
1007 * *
1008 ******************************************************************************/
1017 size_t ts_bspline_num_distinct_knots(const tsBSpline *spline);
1018 
1039 tsError ts_bspline_eval(const tsBSpline *spline, tsReal u,
1040  tsDeBoorNet *_deBoorNet_, 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 
1200 tsError ts_bspline_is_closed(const tsBSpline *spline, tsReal epsilon,
1201  int *closed, tsStatus *status);
1202 
1203 
1204 
1205 /******************************************************************************
1206 * *
1207 * :: Transformation functions *
1208 * *
1209 * TinySpline is a library focusing on transformations. That is, most *
1210 * functions are used to transform splines by modifying their state, e.g., *
1211 * their number of control points, their degree, and so on. Accordingly, each *
1212 * transformation functions specifies an input and output parameter (along *
1213 * with the other parameters required to calculate the actual transformation). *
1214 * By passing a different pointer to the output parameter, the transformation *
1215 * result is calculated and stored without changing the state of the input. *
1216 * This is in particular useful when dealing with errors as the original state *
1217 * will never be modified. For instance, let's have a look at the following *
1218 * code snippet: *
1219 * *
1220 * tsBSpline in = ... // an arbitrary spline *
1221 * tsBSpline out; // result of transformation *
1222 * *
1223 * // Subdivide 'in' into sequence of bezier curves and store the result *
1224 * // in 'out'. Does not change 'in' in any way. *
1225 * tsError err = ts_bspline_to_beziers(&in, &out); *
1226 * if (err != TS_SUCCESS) { *
1227 * // fortunately, 'in' has not been changed *
1228 * } *
1229 * *
1230 * Even if 'ts_bspline_to_beziers' fails, the state of 'in' has not been *
1231 * changed allowing you to handle the error properly. *
1232 * *
1233 * Unless stated otherwise, the order of the parameters for transformation *
1234 * functions is: *
1235 * *
1236 * function(input, [additional_input], output, [additional_output]) *
1237 * *
1238 * 'additional_input' are parameters required to calculate the actual *
1239 * transformation. 'additional_output' are parameters storing further result. *
1240 * *
1241 * Note: None of TinySpline's transformation functions frees the memory of the *
1242 * output parameter. Thus, when using the same output parameter multiple *
1243 * times, make sure to free memory before each call. Otherwise, you will *
1244 * have a bad time with memory leaks: *
1245 * *
1246 * tsBSpline in = ... // an arbitrary spline *
1247 * tsBSpline out; // result of transformations *
1248 * *
1249 * ts_bspline_to_beziers(&in, &out); // first transformation *
1250 * ... // some code *
1251 * ts_bspline_free(&out); // avoid memory leak. *
1252 * ts_bspline_tension(&in, 0.85, &out); // next transformation *
1253 * *
1254 * If you want to modify your input directly without having a separate output, *
1255 * pass it as input and output at once: *
1256 * *
1257 * tsBSpline s = ... // an arbitrary spline *
1258 * tsReal *knots = ... // a knot vector *
1259 * *
1260 * ts_bspline_set_knots(&s, knots, &s); // copy 'knots' into 's' *
1261 * *
1262 * Note: If a transformation function fails *and* input != output, all fields *
1263 * of the output parameter are set to 0/NULL. If input == output, your *
1264 * input may have an invalid state in case of errors. *
1265 * *
1266 ******************************************************************************/
1311 tsError ts_bspline_derive(const tsBSpline *spline, size_t n,
1312  tsBSpline *_derivative_, tsStatus *status);
1313 
1337 tsError ts_bspline_insert_knot(const tsBSpline *spline, tsReal u, size_t n,
1338  tsBSpline *_result_, size_t *_k_, tsStatus *status);
1339 
1364 tsError ts_bspline_split(const tsBSpline *spline, tsReal u, tsBSpline *_split_,
1365  size_t *_k_, tsStatus *status);
1366 
1396 tsError ts_bspline_tension(const tsBSpline *spline, tsReal tension,
1397  tsBSpline *result, tsStatus *status);
1398 
1416 tsError ts_bspline_to_beziers(const tsBSpline *spline, tsBSpline *_beziers_,
1417  tsStatus *status);
1418 
1419 
1420 
1421 /******************************************************************************
1422 * *
1423 * :: Serialization and Persistence Functions *
1424 * *
1425 * The following section contains functions to serialize and persist the data *
1426 * types listed above. *
1427 * *
1428 ******************************************************************************/
1445 tsError ts_bspline_to_json(const tsBSpline *spline, char **_json_,
1446  tsStatus *status);
1447 
1478 tsError ts_bspline_from_json(const char *json, tsBSpline *_spline_,
1479  tsStatus *status);
1480 
1498 tsError ts_bspline_save_json(const tsBSpline *spline, const char *path,
1499  tsStatus *status);
1500 
1533 tsError ts_bspline_load_json(const char *path, tsBSpline *_spline_,
1534  tsStatus *status);
1535 
1536 
1537 
1538 /******************************************************************************
1539 * *
1540 * :: Utility Functions *
1541 * *
1542 * The following section contains utility functions used by TinySpline which *
1543 * also may be helpful when using this library. *
1544 * *
1545 ******************************************************************************/
1560 int ts_knots_equal(tsReal x, tsReal y);
1561 
1566 void ts_arr_fill(tsReal *arr, size_t num, tsReal val);
1567 
1580 tsReal ts_distance(const tsReal *x, const tsReal *y, size_t dim);
1581 
1582 
1583 
1584 #ifdef __cplusplus
1585 }
1586 #endif
1587 
1588 #endif /* TINYSPLINE_H */
1589 
size_t ts_deboornet_len_points(const tsDeBoorNet *net)
Definition: tinyspline.c:343
tsError ts_bspline_load_json(const char *path, tsBSpline *_spline_, tsStatus *status)
Definition: tinyspline.c:1769
tsError ts_bspline_eval_all(const tsBSpline *spline, const tsReal *us, size_t num, tsReal **points, tsStatus *status)
Definition: tinyspline.c:966
struct tsDeBoorNetImpl * pImpl
Definition: tinyspline.h:385
size_t ts_bspline_order(const tsBSpline *spline)
Definition: tinyspline.c:156
tsError ts_deboornet_points(const tsDeBoorNet *net, tsReal **points, tsStatus *status)
Definition: tinyspline.c:358
Definition: tinyspline.h:107
size_t ts_bspline_sof_control_points(const tsBSpline *spline)
Definition: tinyspline.c:203
tsError ts_bspline_set_dimension(tsBSpline *spline, size_t dim, tsStatus *status)
Definition: tinyspline.c:177
tsError ts_bspline_set_knots(tsBSpline *spline, const tsReal *knots, tsStatus *status)
Definition: tinyspline.c:283
Definition: tinyspline.h:103
size_t ts_bspline_num_knots(const tsBSpline *spline)
Definition: tinyspline.c:262
size_t ts_bspline_degree(const tsBSpline *spline)
Definition: tinyspline.c:139
size_t ts_deboornet_num_points(const tsDeBoorNet *net)
Definition: tinyspline.c:348
tsError ts_bspline_knots(const tsBSpline *spline, tsReal **knots, tsStatus *status)
Definition: tinyspline.c:272
size_t ts_bspline_num_distinct_knots(const tsBSpline *spline)
Definition: tinyspline.c:790
Definition: tinyspline.h:102
tsError ts_bspline_interpolate_cubic(const tsReal *points, size_t n, size_t dim, tsBSpline *_spline_, tsStatus *status)
Definition: tinyspline.c:759
Definition: tinyspline.h:101
size_t ts_deboornet_num_insertions(const tsDeBoorNet *net)
Definition: tinyspline.c:333
Definition: tinyspline.h:100
Definition: tinyspline.h:296
void ts_arr_fill(tsReal *arr, size_t num, tsReal val)
Definition: tinyspline.c:1811
void ts_deboornet_move(tsDeBoorNet *src, tsDeBoorNet *dest)
Definition: tinyspline.c:593
tsError ts_bspline_derive(const tsBSpline *spline, size_t n, tsBSpline *_derivative_, tsStatus *status)
Definition: tinyspline.c:1180
size_t ts_deboornet_dimension(const tsDeBoorNet *net)
Definition: tinyspline.c:338
size_t dim
Definition: tinyspline.c:55
tsReal ts_distance(const tsReal *x, const tsReal *y, size_t dim)
Definition: tinyspline.c:1818
tsError ts_bspline_copy(const tsBSpline *src, tsBSpline *dest, tsStatus *status)
Definition: tinyspline.c:504
Definition: tinyspline.h:118
Definition: tinyspline.h:112
void ts_bspline_domain(const tsBSpline *spline, tsReal *min, tsReal *max)
Definition: tinyspline.c:1090
tsError ts_bspline_control_points(const tsBSpline *spline, tsReal **ctrlp, tsStatus *status)
Definition: tinyspline.c:208
tsDeBoorNet ts_deboornet_init()
Definition: tinyspline.c:536
tsError ts_bspline_save_json(const tsBSpline *spline, const char *path, tsStatus *status)
Definition: tinyspline.c:1755
tsError ts_bspline_set_control_point_at(tsBSpline *spline, size_t index, const tsReal *ctrlp, tsStatus *status)
Definition: tinyspline.c:248
tsError ts_bspline_tension(const tsBSpline *spline, tsReal tension, tsBSpline *result, tsStatus *status)
Definition: tinyspline.c:1399
size_t ts_bspline_dimension(const tsBSpline *spline)
Definition: tinyspline.c:172
tsError ts_bspline_set_degree(tsBSpline *spline, size_t deg, tsStatus *status)
Definition: tinyspline.c:144
tsError ts_bspline_set_order(tsBSpline *spline, size_t order, tsStatus *status)
Definition: tinyspline.c:161
size_t ts_deboornet_index(const tsDeBoorNet *net)
Definition: tinyspline.c:323
tsBSpline ts_bspline_init()
Definition: tinyspline.c:402
Definition: tinyspline.h:110
Definition: tinyspline.h:105
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:1033
Definition: tinyspline.h:383
tsError ts_bspline_to_json(const tsBSpline *spline, char **_json_, tsStatus *status)
Definition: tinyspline.c:1721
Definition: tinyspline.h:104
void ts_deboornet_free(tsDeBoorNet *net)
Definition: tinyspline.c:571
Definition: tinyspline.h:108
tsError ts_bspline_to_beziers(const tsBSpline *spline, tsBSpline *_beziers_, tsStatus *status)
Definition: tinyspline.c:1425
tsError ts_bspline_control_point_at(const tsBSpline *spline, size_t index, tsReal **ctrlp, tsStatus *status)
Definition: tinyspline.c:219
int ts_knots_equal(tsReal x, tsReal y)
Definition: tinyspline.c:1806
size_t ts_bspline_sof_knots(const tsBSpline *spline)
Definition: tinyspline.c:267
void ts_bspline_move(tsBSpline *src, tsBSpline *dest)
Definition: tinyspline.c:519
Definition: tinyspline.h:99
size_t ts_deboornet_sof_result(const tsDeBoorNet *net)
Definition: tinyspline.c:379
Definition: tinyspline.h:111
Definition: tinyspline.c:38
tsError ts_bspline_new(size_t num_control_points, size_t dimension, size_t degree, tsBSplineType type, tsBSpline *spline, tsStatus *status)
Definition: tinyspline.c:456
tsError ts_deboornet_copy(const tsDeBoorNet *src, tsDeBoorNet *dest, tsStatus *status)
Definition: tinyspline.c:578
size_t ts_bspline_num_control_points(const tsBSpline *spline)
Definition: tinyspline.c:198
size_t ts_deboornet_len_result(const tsDeBoorNet *net)
Definition: tinyspline.c:369
tsError ts_bspline_split(const tsBSpline *spline, tsReal u, tsBSpline *_split_, size_t *_k_, tsStatus *status)
Definition: tinyspline.c:1370
tsError ts_bspline_set_control_points(tsBSpline *spline, const tsReal *ctrlp, tsStatus *status)
Definition: tinyspline.c:240
tsError ts_bspline_insert_knot(const tsBSpline *spline, tsReal u, size_t n, tsBSpline *_result_, size_t *_k_, tsStatus *status)
Definition: tinyspline.c:1349
struct tsBSplineImpl * pImpl
Definition: tinyspline.h:298
tsError ts_bspline_is_closed(const tsBSpline *spline, tsReal epsilon, int *closed, tsStatus *status)
Definition: tinyspline.c:1098
Definition: tinyspline.c:49
size_t ts_deboornet_sof_points(const tsDeBoorNet *net)
Definition: tinyspline.c:353
size_t ts_deboornet_num_result(const tsDeBoorNet *net)
Definition: tinyspline.c:374
tsError code
Definition: tinyspline.h:119
tsError ts_bspline_from_json(const char *json, tsBSpline *_spline_, tsStatus *status)
Definition: tinyspline.c:1735
Definition: tinyspline.h:109
Definition: tinyspline.h:106
tsError
Definition: tinyspline.h:98
tsReal ts_deboornet_knot(const tsDeBoorNet *net)
Definition: tinyspline.c:318
tsError ts_bspline_eval(const tsBSpline *spline, tsReal u, tsDeBoorNet *_deBoorNet_, tsStatus *status)
Definition: tinyspline.c:951
void ts_bspline_free(tsBSpline *spline)
Definition: tinyspline.c:527
tsBSplineType
Definition: tinyspline.h:258
size_t ts_deboornet_multiplicity(const tsDeBoorNet *net)
Definition: tinyspline.c:328
tsError ts_deboornet_result(const tsDeBoorNet *net, tsReal **result, tsStatus *status)
Definition: tinyspline.c:384
size_t ts_bspline_len_control_points(const tsBSpline *spline)
Definition: tinyspline.c:192
tsError ts_bspline_sample(const tsBSpline *spline, size_t num, tsReal **points, size_t *actual_num, tsStatus *status)
Definition: tinyspline.c:999