Xinqi Bao's Git

README.md: updated paper url
[XbSlicer.git] / src / Slicing.hh
1 #pragma once
2
3 /*
4 @author: Xinqi Bao
5 With a particular z, get lines from triangles at this position.
6 Then make loops from the pool of intersections, store the result into
7 layer object.
8 */
9
10 #include <vector>
11
12 #include "Cross.hh"
13 #include "GCode.hh"
14 #include "Loop.hh"
15 #include "STL.hh"
16 #include "Triangle.hh"
17
18 class Slicing
19 {
20 private:
21 double z;
22 std::vector<Loop>& loops;
23 std::vector<Triangle>& triangles;
24 std::vector<Cross> intersections;
25 bool isCross(const Vec3d& v_1, const Vec3d& v_2) const;
26 bool isSectionExist(Cross& cr) const;
27 void intersection();
28 void mkLoop();
29
30 public:
31 Slicing(Stl* stl, Layer* layer);
32 Slicing(Stl& stl, Layer& layer);
33
34 void printVector() const;
35 void printLoop() const;
36 };