mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-10-21 07:41:09 -06:00
Ported ExtrusionPath to XS. Failing test for Surface
This commit is contained in:
parent
8c1e1cc3ea
commit
f612d4c64e
24 changed files with 501 additions and 143 deletions
60
xs/src/ExtrusionEntity.hpp
Normal file
60
xs/src/ExtrusionEntity.hpp
Normal file
|
@ -0,0 +1,60 @@
|
|||
#ifndef slic3r_ExtrusionEntity_hpp_
|
||||
#define slic3r_ExtrusionEntity_hpp_
|
||||
|
||||
extern "C" {
|
||||
#include "EXTERN.h"
|
||||
#include "perl.h"
|
||||
#include "XSUB.h"
|
||||
#include "ppport.h"
|
||||
}
|
||||
|
||||
#include "Polygon.hpp"
|
||||
#include "Polyline.hpp"
|
||||
|
||||
namespace Slic3r {
|
||||
|
||||
enum ExtrusionRole {
|
||||
erPerimeter,
|
||||
erExternalPerimeter,
|
||||
erOverhangPerimeter,
|
||||
erContourInternalPerimeter,
|
||||
erFill,
|
||||
erSolidFill,
|
||||
erTopSolidFill,
|
||||
erBrige,
|
||||
erInternalBridge,
|
||||
erSkirt,
|
||||
erSupportMaterial,
|
||||
erGapFill,
|
||||
};
|
||||
|
||||
class ExtrusionEntity
|
||||
{
|
||||
public:
|
||||
ExtrusionRole role;
|
||||
double height; // vertical thickness of the extrusion expressed in mm
|
||||
double flow_spacing;
|
||||
};
|
||||
|
||||
class ExtrusionPath : public ExtrusionEntity
|
||||
{
|
||||
public:
|
||||
Polyline polyline;
|
||||
void reverse();
|
||||
};
|
||||
|
||||
class ExtrusionLoop : public ExtrusionEntity
|
||||
{
|
||||
public:
|
||||
Polygon polygon;
|
||||
};
|
||||
|
||||
void
|
||||
ExtrusionPath::reverse()
|
||||
{
|
||||
this->polyline.reverse();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#endif
|
|
@ -9,6 +9,7 @@ extern "C" {
|
|||
}
|
||||
|
||||
#include "Point.hpp"
|
||||
#include <algorithm>
|
||||
|
||||
namespace Slic3r {
|
||||
|
||||
|
@ -19,6 +20,7 @@ class Polyline
|
|||
void scale(double factor);
|
||||
void translate(double x, double y);
|
||||
void rotate(double angle, Point* center);
|
||||
void reverse();
|
||||
};
|
||||
|
||||
typedef std::vector<Polyline> Polylines;
|
||||
|
@ -49,6 +51,12 @@ Polyline::rotate(double angle, Point* center)
|
|||
}
|
||||
}
|
||||
|
||||
void
|
||||
Polyline::reverse()
|
||||
{
|
||||
std::reverse(this->points.begin(), this->points.end());
|
||||
}
|
||||
|
||||
void
|
||||
perl2polyline(SV* poly_sv, Polyline& poly)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue