TinySpline
NURBS 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 
653 tsError ts_bspline_set_knots(tsBSpline *spline, const tsReal *knots,
654  tsStatus *status);
655 
656 /* ------------------------------------------------------------------------- */
657 
666 tsReal ts_deboornet_knot(const tsDeBoorNet *net);
667 
676 size_t ts_deboornet_index(const tsDeBoorNet *net);
677 
686 size_t ts_deboornet_multiplicity(const tsDeBoorNet *net);
687 
698 size_t ts_deboornet_num_insertions(const tsDeBoorNet *net);
699 
711 size_t ts_deboornet_dimension(const tsDeBoorNet *net);
712 
721 size_t ts_deboornet_len_points(const tsDeBoorNet *net);
722 
731 size_t ts_deboornet_num_points(const tsDeBoorNet *net);
732 
742 size_t ts_deboornet_sof_points(const tsDeBoorNet *net);
743 
758 tsError ts_deboornet_points(const tsDeBoorNet *net, tsReal **points,
759  tsStatus *status);
760 
769 size_t ts_deboornet_len_result(const tsDeBoorNet *net);
770 
780 size_t ts_deboornet_num_result(const tsDeBoorNet *net);
781 
791 size_t ts_deboornet_sof_result(const tsDeBoorNet *net);
792 
807 tsError ts_deboornet_result(const tsDeBoorNet *net, tsReal **result,
808  tsStatus *status);
809 
810 
811 
812 /******************************************************************************
813 * *
814 * :: Constructors, Destructors, Copy, and Move Functions *
815 * *
816 * The following section contains functions to create and delete instances of *
817 * the data types listed above. Additionally, each data type has a copy and *
818 * move function. *
819 * *
820 ******************************************************************************/
828 
856 tsError ts_bspline_new(size_t num_control_points, size_t dimension,
857  size_t degree, tsBSplineType type, tsBSpline *spline,
858  tsStatus *status);
859 
875 tsError ts_bspline_copy(const tsBSpline *src, tsBSpline *dest,
876  tsStatus *status);
877 
888 void ts_bspline_move(tsBSpline *src, tsBSpline *dest);
889 
897 void ts_bspline_free(tsBSpline *spline);
898 
899 /* ------------------------------------------------------------------------- */
900 
908 
925  tsStatus *status);
926 
937 void ts_deboornet_move(tsDeBoorNet *src, tsDeBoorNet *dest);
938 
946 void ts_deboornet_free(tsDeBoorNet *net);
947 
948 
949 
950 /******************************************************************************
951 * *
952 * :: Interpolation and Approximation Functions *
953 * *
954 * The following section contains functions to interpolate and approximate *
955 * arbitrary splines. *
956 * *
957 ******************************************************************************/
998 tsError ts_bspline_interpolate_cubic(const tsReal *points, size_t n,
999  size_t dim, tsBSpline *_spline_, tsStatus *status);
1000 
1001 
1002 
1003 /******************************************************************************
1004 * *
1005 * :: Query Functions *
1006 * *
1007 * The following section contains functions to query splines. *
1008 * *
1009 ******************************************************************************/
1018 size_t ts_bspline_num_distinct_knots(const tsBSpline *spline);
1019 
1040 tsError ts_bspline_eval(const tsBSpline *spline, tsReal u,
1041  tsDeBoorNet *_deBoorNet_, tsStatus *status);
1042 
1072 tsError ts_bspline_eval_all(const tsBSpline *spline, const tsReal *us,
1073  size_t num, tsReal **points, tsStatus *status);
1074 
1106 tsError ts_bspline_sample(const tsBSpline *spline, size_t num, tsReal **points,
1107  size_t *actual_num, tsStatus *status);
1108 
1164 tsError ts_bspline_bisect(const tsBSpline *spline, tsReal value,
1165  tsReal epsilon, int persnickety, size_t index, int ascending,
1166  size_t max_iter, tsDeBoorNet *net, tsStatus *status);
1167 
1178 void ts_bspline_domain(const tsBSpline *spline, tsReal *min, tsReal *max);
1179 
1201 tsError ts_bspline_is_closed(const tsBSpline *spline, tsReal epsilon,
1202  int *closed, tsStatus *status);
1203 
1204 
1205 
1206 /******************************************************************************
1207 * *
1208 * :: Transformation functions *
1209 * *
1210 * TinySpline is a library focusing on transformations. That is, most *
1211 * functions are used to transform splines by modifying their state, e.g., *
1212 * their number of control points, their degree, and so on. Accordingly, each *
1213 * transformation functions specifies an input and output parameter (along *
1214 * with the other parameters required to calculate the actual transformation). *
1215 * By passing a different pointer to the output parameter, the transformation *
1216 * result is calculated and stored without changing the state of the input. *
1217 * This is in particular useful when dealing with errors as the original state *
1218 * will never be modified. For instance, let's have a look at the following *
1219 * code snippet: *
1220 * *
1221 * tsBSpline in = ... // an arbitrary spline *
1222 * tsBSpline out; // result of transformation *
1223 * *
1224 * // Subdivide 'in' into sequence of bezier curves and store the result *
1225 * // in 'out'. Does not change 'in' in any way. *
1226 * tsError err = ts_bspline_to_beziers(&in, &out); *
1227 * if (err != TS_SUCCESS) { *
1228 * // fortunately, 'in' has not been changed *
1229 * } *
1230 * *
1231 * Even if 'ts_bspline_to_beziers' fails, the state of 'in' has not been *
1232 * changed allowing you to handle the error properly. *
1233 * *
1234 * Unless stated otherwise, the order of the parameters for transformation *
1235 * functions is: *
1236 * *
1237 * function(input, [additional_input], output, [additional_output]) *
1238 * *
1239 * 'additional_input' are parameters required to calculate the actual *
1240 * transformation. 'additional_output' are parameters storing further result. *
1241 * *
1242 * Note: None of TinySpline's transformation functions frees the memory of the *
1243 * output parameter. Thus, when using the same output parameter multiple *
1244 * times, make sure to free memory before each call. Otherwise, you will *
1245 * have a bad time with memory leaks: *
1246 * *
1247 * tsBSpline in = ... // an arbitrary spline *
1248 * tsBSpline out; // result of transformations *
1249 * *
1250 * ts_bspline_to_beziers(&in, &out); // first transformation *
1251 * ... // some code *
1252 * ts_bspline_free(&out); // avoid memory leak. *
1253 * ts_bspline_tension(&in, 0.85, &out); // next transformation *
1254 * *
1255 * If you want to modify your input directly without having a separate output, *
1256 * pass it as input and output at once: *
1257 * *
1258 * tsBSpline s = ... // an arbitrary spline *
1259 * tsReal *knots = ... // a knot vector *
1260 * *
1261 * ts_bspline_set_knots(&s, knots, &s); // copy 'knots' into 's' *
1262 * *
1263 * Note: If a transformation function fails *and* input != output, all fields *
1264 * of the output parameter are set to 0/NULL. If input == output, your *
1265 * input may have an invalid state in case of errors. *
1266 * *
1267 ******************************************************************************/
1312 tsError ts_bspline_derive(const tsBSpline *spline, size_t n,
1313  tsBSpline *_derivative_, tsStatus *status);
1314 
1338 tsError ts_bspline_insert_knot(const tsBSpline *spline, tsReal u, size_t n,
1339  tsBSpline *_result_, size_t *_k_, tsStatus *status);
1340 
1365 tsError ts_bspline_split(const tsBSpline *spline, tsReal u, tsBSpline *_split_,
1366  size_t *_k_, tsStatus *status);
1367 
1397 tsError ts_bspline_tension(const tsBSpline *spline, tsReal tension,
1398  tsBSpline *result, tsStatus *status);
1399 
1417 tsError ts_bspline_to_beziers(const tsBSpline *spline, tsBSpline *_beziers_,
1418  tsStatus *status);
1419 
1420 
1421 
1422 /******************************************************************************
1423 * *
1424 * :: Serialization and Persistence Functions *
1425 * *
1426 * The following section contains functions to serialize and persist the data *
1427 * types listed above. *
1428 * *
1429 ******************************************************************************/
1446 tsError ts_bspline_to_json(const tsBSpline *spline, char **_json_,
1447  tsStatus *status);
1448 
1479 tsError ts_bspline_from_json(const char *json, tsBSpline *_spline_,
1480  tsStatus *status);
1481 
1499 tsError ts_bspline_save_json(const tsBSpline *spline, const char *path,
1500  tsStatus *status);
1501 
1534 tsError ts_bspline_load_json(const char *path, tsBSpline *_spline_,
1535  tsStatus *status);
1536 
1537 
1538 
1539 /******************************************************************************
1540 * *
1541 * :: Utility Functions *
1542 * *
1543 * The following section contains utility functions used by TinySpline which *
1544 * also may be helpful when using this library. *
1545 * *
1546 ******************************************************************************/
1561 int ts_knots_equal(tsReal x, tsReal y);
1562 
1567 void ts_arr_fill(tsReal *arr, size_t num, tsReal val);
1568 
1581 tsReal ts_distance(const tsReal *x, const tsReal *y, size_t dim);
1582 
1583 
1584 
1585 #ifdef __cplusplus
1586 }
1587 #endif
1588 
1589 #endif /* TINYSPLINE_H */
1590 
size_t ts_deboornet_len_points(const tsDeBoorNet *net)
Definition: tinyspline.c:353
tsError ts_bspline_load_json(const char *path, tsBSpline *_spline_, tsStatus *status)
Definition: tinyspline.c:1778
tsError ts_bspline_eval_all(const tsBSpline *spline, const tsReal *us, size_t num, tsReal **points, tsStatus *status)
Definition: tinyspline.c:976
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:368
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:358
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:800
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:769
Definition: tinyspline.h:101
size_t ts_deboornet_num_insertions(const tsDeBoorNet *net)
Definition: tinyspline.c:343
Definition: tinyspline.h:100
Definition: tinyspline.h:296
void ts_arr_fill(tsReal *arr, size_t num, tsReal val)
Definition: tinyspline.c:1820
void ts_deboornet_move(tsDeBoorNet *src, tsDeBoorNet *dest)
Definition: tinyspline.c:603
tsError ts_bspline_derive(const tsBSpline *spline, size_t n, tsBSpline *_derivative_, tsStatus *status)
Definition: tinyspline.c:1190
size_t ts_deboornet_dimension(const tsDeBoorNet *net)
Definition: tinyspline.c:348
size_t dim
Definition: tinyspline.c:55
tsReal ts_distance(const tsReal *x, const tsReal *y, size_t dim)
Definition: tinyspline.c:1827
tsError ts_bspline_copy(const tsBSpline *src, tsBSpline *dest, tsStatus *status)
Definition: tinyspline.c:514
Definition: tinyspline.h:118
Definition: tinyspline.h:112
void ts_bspline_domain(const tsBSpline *spline, tsReal *min, tsReal *max)
Definition: tinyspline.c:1100
tsError ts_bspline_control_points(const tsBSpline *spline, tsReal **ctrlp, tsStatus *status)
Definition: tinyspline.c:208
tsDeBoorNet ts_deboornet_init()
Definition: tinyspline.c:546
tsError ts_bspline_save_json(const tsBSpline *spline, const char *path, tsStatus *status)
Definition: tinyspline.c:1764
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:1409
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:333
tsBSpline ts_bspline_init()
Definition: tinyspline.c:412
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:1043
Definition: tinyspline.h:383
tsError ts_bspline_to_json(const tsBSpline *spline, char **_json_, tsStatus *status)
Definition: tinyspline.c:1730
Definition: tinyspline.h:104
void ts_deboornet_free(tsDeBoorNet *net)
Definition: tinyspline.c:581
Definition: tinyspline.h:108
tsError ts_bspline_to_beziers(const tsBSpline *spline, tsBSpline *_beziers_, tsStatus *status)
Definition: tinyspline.c:1435
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:1815
size_t ts_bspline_sof_knots(const tsBSpline *spline)
Definition: tinyspline.c:267
void ts_bspline_move(tsBSpline *src, tsBSpline *dest)
Definition: tinyspline.c:529
Definition: tinyspline.h:99
size_t ts_deboornet_sof_result(const tsDeBoorNet *net)
Definition: tinyspline.c:389
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:466
tsError ts_deboornet_copy(const tsDeBoorNet *src, tsDeBoorNet *dest, tsStatus *status)
Definition: tinyspline.c:588
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:379
tsError ts_bspline_split(const tsBSpline *spline, tsReal u, tsBSpline *_split_, size_t *_k_, tsStatus *status)
Definition: tinyspline.c:1380
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:1359
struct tsBSplineImpl * pImpl
Definition: tinyspline.h:298
tsError ts_bspline_is_closed(const tsBSpline *spline, tsReal epsilon, int *closed, tsStatus *status)
Definition: tinyspline.c:1108
Definition: tinyspline.c:49
size_t ts_deboornet_sof_points(const tsDeBoorNet *net)
Definition: tinyspline.c:363
size_t ts_deboornet_num_result(const tsDeBoorNet *net)
Definition: tinyspline.c:384
tsError code
Definition: tinyspline.h:119
tsError ts_bspline_from_json(const char *json, tsBSpline *_spline_, tsStatus *status)
Definition: tinyspline.c:1744
Definition: tinyspline.h:109
Definition: tinyspline.h:106
tsError
Definition: tinyspline.h:98
tsReal ts_deboornet_knot(const tsDeBoorNet *net)
Definition: tinyspline.c:328
tsError ts_bspline_eval(const tsBSpline *spline, tsReal u, tsDeBoorNet *_deBoorNet_, tsStatus *status)
Definition: tinyspline.c:961
void ts_bspline_free(tsBSpline *spline)
Definition: tinyspline.c:537
tsBSplineType
Definition: tinyspline.h:258
size_t ts_deboornet_multiplicity(const tsDeBoorNet *net)
Definition: tinyspline.c:338
tsError ts_deboornet_result(const tsDeBoorNet *net, tsReal **result, tsStatus *status)
Definition: tinyspline.c:394
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:1009