-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathopencscad.h
79 lines (65 loc) · 2.87 KB
/
opencscad.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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
#ifndef __OPENCSCAD_H__
#define __OPENCSCAD_H__
/*
opencscad : little library to do metaprogramming of OpenSCAD
Copyright (C) 2011 Stephen M. Cameron
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef DEFINE_OPENCSCAD_GLOBALS
#define OPENCSCAD_GLOBAL extern
#else
#define OPENCSCAD_GLOBAL
#endif
extern FILE *output;
struct opencscad_2dpoint {
double x, y;
};
OPENCSCAD_GLOBAL void cube(double x, double y, double z, int center) ;
OPENCSCAD_GLOBAL void sphere(double r);
OPENCSCAD_GLOBAL void cylinder(double h, double r1, double r2);
OPENCSCAD_GLOBAL void cyl(double h, double r1, double r2, int centered);
OPENCSCAD_GLOBAL void angular_cylinder(double h, double r1, double r2, double fa);
OPENCSCAD_GLOBAL void angular_cyl(double h, double r1, double r2, double fa, int centered);
OPENCSCAD_GLOBAL void onion(void); /* union is reserved word in c. */
OPENCSCAD_GLOBAL void endonion(void);
OPENCSCAD_GLOBAL void diff(void);
OPENCSCAD_GLOBAL void enddiff(void);
OPENCSCAD_GLOBAL void intersection(void);
OPENCSCAD_GLOBAL void endintersection(void);
OPENCSCAD_GLOBAL void xlate(double x, double y, double z);
OPENCSCAD_GLOBAL void endxlate(void);
OPENCSCAD_GLOBAL void scale(double x, double y, double z);
OPENCSCAD_GLOBAL void endscale(void);
OPENCSCAD_GLOBAL void rotate(double angle, double x, double y, double z);
OPENCSCAD_GLOBAL void endrotate(void);
OPENCSCAD_GLOBAL void mirror(double x, double y, double z);
/* 2d primitives */
OPENCSCAD_GLOBAL void square(double x, double y, int center);
OPENCSCAD_GLOBAL void circle(double r);
/* path is an array of pointers to arrays of ints. The ints are
* indexes into the point array. The lists of ints are terminted by
* the value -1.
*/
OPENCSCAD_GLOBAL void polygon(struct opencscad_2dpoint point[], int npoints,
int *path[]);
OPENCSCAD_GLOBAL void module(char *module_name);
OPENCSCAD_GLOBAL void end_module(void);
OPENCSCAD_GLOBAL void end(void);
OPENCSCAD_GLOBAL void call_module(char *module_name);
OPENCSCAD_GLOBAL void radial_dist(int count, float r);
OPENCSCAD_GLOBAL void end_radial_dist(void);
OPENCSCAD_GLOBAL void opencscad_init(void);
OPENCSCAD_GLOBAL void scadinline(const char *format, ...);
OPENCSCAD_GLOBAL void finalize(void);
#undef OPENCSCAD_GLOBAL
#endif