Files
OrcaSlicer-bambulab/xs/src/TriangleMesh.hpp
T

59 lines
1.4 KiB
C++
Raw Normal View History

2013-07-06 15:26:32 +02:00
#ifndef slic3r_TriangleMesh_hpp_
#define slic3r_TriangleMesh_hpp_
#include <myinit.h>
2013-06-24 19:35:49 +02:00
#include <admesh/stl.h>
2013-09-07 14:06:09 +02:00
#include <vector>
2013-08-05 19:52:37 +02:00
#include "Point.hpp"
2013-09-07 14:06:09 +02:00
#include "Polygon.hpp"
2013-06-24 19:35:49 +02:00
namespace Slic3r {
2013-06-24 19:35:49 +02:00
class TriangleMesh
{
public:
TriangleMesh();
~TriangleMesh();
void ReadSTLFile(char* input_file);
2013-07-03 11:38:01 +02:00
void ReadFromPerl(SV* vertices, SV* facets);
2013-06-24 19:35:49 +02:00
void Repair();
void WriteOBJFile(char* output_file);
2013-08-04 21:34:26 +02:00
void scale(float factor);
2013-08-05 10:48:38 +02:00
void translate(float x, float y, float z);
2013-08-05 19:22:33 +02:00
void align_to_origin();
2013-08-05 19:52:37 +02:00
void rotate(double angle, Point* center);
2013-09-07 14:06:09 +02:00
std::vector<Polygons>* slice(const std::vector<double> &z);
2013-09-09 21:41:28 +02:00
std::vector<TriangleMesh> split() const;
2013-06-24 19:35:49 +02:00
stl_file stl;
};
2013-09-07 21:08:53 +02:00
enum FacetEdgeType { feNone, feTop, feBottom };
class IntersectionPoint : public Point
{
public:
int point_id;
int edge_id;
IntersectionPoint() : point_id(-1), edge_id(-1) {};
};
class IntersectionLine
{
public:
Point a;
Point b;
int a_id;
int b_id;
int edge_a_id;
int edge_b_id;
FacetEdgeType edge_type;
2013-09-08 00:44:01 +02:00
bool skip;
IntersectionLine() : a_id(-1), b_id(-1), edge_a_id(-1), edge_b_id(-1), edge_type(feNone), skip(false) {};
2013-09-07 21:08:53 +02:00
};
typedef std::vector<IntersectionLine> IntersectionLines;
2013-09-08 00:44:01 +02:00
typedef std::vector<IntersectionLine*> IntersectionLinePtrs;
2013-09-07 21:08:53 +02:00
}
2013-07-06 15:26:32 +02:00
#endif