-
Notifications
You must be signed in to change notification settings - Fork 25
/
spiro.h
58 lines (46 loc) · 1.45 KB
/
spiro.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
/* spiro.h
libspiro - A sharable library of Spiro formula and functions.
*/
#ifndef _SPIRO_H
#define _SPIRO_H
#ifdef __cplusplus
extern "C" {
#endif
typedef struct {
/* User passes an array of SpiroCP in this format for Spiro to solve */
double x; /* Spiro CodePoint Xloc */
double y; /* Spiro CodePoint Yloc */
char ty; /* Spiro CodePoint Type */
} spiro_cp;
struct spiro_seg_s {
/* run_spiro() uses array of information given in the structure above and */
/* creates an array in this structure format to use by spiro_to_bpath for */
/* building bezier curves */
double x; /* SpiroCP segment_chord startX */
double y; /* SpiroCP segment_chord startY */
char ty; /* Spiro CodePoint Type */
double bend_th; /* bend theta between this vector and next vector */
double ks[4];
double seg_ch; /* segment_chord distance from xy to next SpiroCP */
double seg_th; /* segment_theta angle for this SpiroCP */
double l;
};
typedef struct spiro_seg_s spiro_seg;
spiro_seg *
run_spiro(const spiro_cp *src, int n); /* deprecated */
void
free_spiro(spiro_seg *s);
void
spiro_to_bpath(const spiro_seg *s, int n, bezctx *bc); /* deprecated */
double get_knot_th(const spiro_seg *s, int i);
spiro_seg *
run_spiro0(const spiro_cp *src, double *dm, int ncq, int n);
int
spiro_to_bpath0(const spiro_cp *src, const spiro_seg *s,
double *dm, int ncq, int n, bezctx *bc);
const char *
LibSpiroVersion(void);
#ifdef __cplusplus
}
#endif
#endif