-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmodelSTL.h
More file actions
38 lines (29 loc) · 795 Bytes
/
modelSTL.h
File metadata and controls
38 lines (29 loc) · 795 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
#ifndef _readerSTL_h_
#define _readerSTL_h_
#include <vector>
#include <string>
#include "triangle.h"
#include "object3d.h"
class ModelSTL : public Object3d
{
std::vector<Triangle> elements;
float3 min;
float3 max;
float3 size;
float3 origin;
public:
void calSize();
void read(std::string name);
void print();
float3 GetSize(){return size;}
float3 GetOrigin(){return origin;}
bool intersection( float3& origin, float3& direction, float3& oNormal, float3& oPoint, Color& color);
void scale(float value);
void move(float3 value);
void addTriangle(Triangle triangle){elements.push_back(triangle);}
void clear(){elements.clear();}
Triangle GetTriangle(int i) {return elements[i];}
void rotate(float phi, float psi, float tetha);
Ray interaction(Ray ray);
};
#endif