Merge branch 'master' into xsdata

Conflicts:
	lib/Slic3r/GCode.pm
	xs/src/Point.hpp
This commit is contained in:
Alessandro Ranellucci 2013-07-13 21:00:19 +02:00
commit 31809d473f
14 changed files with 127 additions and 16 deletions

View file

@ -10,6 +10,8 @@ extern "C" {
#include "Point.hpp"
namespace Slic3r {
typedef std::vector<Point> Polygon;
typedef std::vector<Polygon> Polygons;
@ -98,4 +100,6 @@ polygon2perl(Polygon& poly) {
return sv_bless(newRV_noinc((SV*)av), gv_stashpv("Slic3r::Polygon", GV_ADD));
}
}
#endif

View file

@ -10,6 +10,8 @@ extern "C" {
#include <math.h>
namespace Slic3r {
class Point
{
public:
@ -36,4 +38,6 @@ point2perl(Point& point) {
return sv_bless(newRV_noinc((SV*)av), gv_stashpv("Slic3r::Point", GV_ADD));
}
}
#endif

View file

@ -1,5 +1,7 @@
#include "TriangleMesh.hpp"
namespace Slic3r {
TriangleMesh::TriangleMesh() {}
TriangleMesh::~TriangleMesh() {
stl_close(&stl);
@ -86,6 +88,12 @@ TriangleMesh::Repair() {
// normal_values
stl_fix_normal_values(&stl);
// always calculate the volume and reverse all normals if volume is negative
stl_calculate_volume(&stl);
// neighbors
stl_verify_neighbors(&stl);
}
void
@ -130,3 +138,5 @@ TriangleMesh::ToPerl() {
av_store(result, 1, newRV_noinc((SV*)facets));
return result;
}
}

View file

@ -10,6 +10,8 @@ extern "C" {
#include "ppport.h"
}
namespace Slic3r {
class TriangleMesh
{
public:
@ -20,8 +22,9 @@ class TriangleMesh
void Repair();
void WriteOBJFile(char* output_file);
AV* ToPerl();
private:
stl_file stl;
};
}
#endif

View file

@ -8,6 +8,8 @@ extern "C" {
#include "ppport.h"
}
namespace Slic3r {
class ZTable
{
public:
@ -21,4 +23,6 @@ ZTable::ZTable(std::vector<unsigned int>* ztable) :
{
}
}
#endif

View file

@ -3,6 +3,9 @@
#include <vector>
namespace Slic3r {}
using namespace Slic3r;
#define av_store_point_xy(AV, X, Y) \
av_store(AV, 0, newSViv(X)); \
av_store(AV, 1, newSViv(Y))