-
Notifications
You must be signed in to change notification settings - Fork 0
/
polyhedron.h
51 lines (42 loc) · 1.03 KB
/
polyhedron.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
/**
* Polyhedron definition and some common polyhedron generators.
*
* Polyhedron inner space coordinate system is left-handed.
*/
#ifndef _POLYHEDRON_H_
#define _POLYHEDRON_H_
#include <stdint.h> // We eschew SDL2 Uint32 for our lovable C version (which is the same).
#include "geop.h"
/**
* The face of a polyhedron.
*/
/*
struct PlanarPolygon {
struct XYZ *vertex;
Uint32 vertices;
*/
/**
* A concave polyhedron.
*/
typedef struct Polyhedron {
C3 *vertex;
int32_t vertices;
} Polyhedron;
/**
* Free memory allocated for the `Polyhedron`.
*/
void
PH_free_polyhedron(Polyhedron **polyhedron);
/**
* Make a deep copy of an existing `Polyhedron`. Mainly to allocate a same size memory
* chunk with which to store the translated form of a model.
*/
Polyhedron *
PH_clone_polyhedron(Polyhedron *polyhedron);
/**
* Return a cube with the center oriented at (0, 0, 0). This function allocates memory
* for the returned `Polyhedron` struct describing the cube.
*/
Polyhedron *
PH_construct_cube(const double side_length);
#endif