Ported TriangleMesh->rotate

This commit is contained in:
Alessandro Ranellucci 2013-08-05 19:52:37 +02:00
parent 9402898c58
commit d881c5ab2f
4 changed files with 14 additions and 1 deletions

View file

@ -123,4 +123,11 @@ void TriangleMesh::align_to_origin()
);
}
void TriangleMesh::rotate(double angle, Point* center)
{
this->translate(-center->x, -center->y, 0);
stl_rotate_z(&(this->stl), (float)angle);
this->translate(+center->x, +center->y, 0);
}
}

View file

@ -3,6 +3,7 @@
#include <myinit.h>
#include <admesh/stl.h>
#include "Point.hpp"
namespace Slic3r {
@ -18,6 +19,7 @@ class TriangleMesh
void scale(float factor);
void translate(float x, float y, float z);
void align_to_origin();
void rotate(double angle, Point* center);
stl_file stl;
};