-
Notifications
You must be signed in to change notification settings - Fork 13
Expand file tree
/
Copy pathparse_stl.h
More file actions
40 lines (29 loc) · 722 Bytes
/
parse_stl.h
File metadata and controls
40 lines (29 loc) · 722 Bytes
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
#ifndef PARSE_STL_H
#define PARSE_STL_H
#include <string>
#include <vector>
namespace stl {
struct point {
float x;
float y;
float z;
point() : x(0), y(0), z(0) {}
point(float xp, float yp, float zp) : x(xp), y(yp), z(zp) {}
};
struct triangle {
point normal;
point v1;
point v2;
point v3;
triangle(point normalp, point v1p, point v2p, point v3p) :
normal(normalp), v1(v1p), v2(v2p), v3(v3p) {}
};
std::ostream& operator<<(std::ostream& out, const triangle& t);
struct stl_data {
std::string name;
std::vector<triangle> triangles;
stl_data(std::string namep) : name(namep) {}
};
stl_data parse_stl(const std::string& stl_path);
}
#endif