-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
34 lines (28 loc) · 1.8 KB
/
main.cpp
File metadata and controls
34 lines (28 loc) · 1.8 KB
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
#include "Obj.h"
#include <iostream>
int main()
{
Object obj;
obj.load("C:/Users/f/source/repos/Poly/Topex-Posidon-composite.obj");
//obj.add_poly();
for (int face_index = 0; face_index < obj._faces.size(); ++face_index)
{
std::cout << "face " << face_index << ": ";
Face& face = obj._faces[face_index];
face.triangulate();
//печать исходных вершин
for(const FaceElement& e: face._fs)
{
const GeoVertex vertex = e.geo_vertex(obj);
std::cout << "(" << vertex.x << " " << vertex.y << " " << vertex.z << ")";
std::cout << " ";
}
std::cout << std::endl;
//печать треугольников
for(const Triangle& triangle: face._triangles)
{
std::cout << triangle._a << " "<< triangle._b << " " << triangle._c;
}
}
return 0;
}