2013-07-15 10:14:22 +00:00
|
|
|
%module{Slic3r::XS};
|
|
|
|
|
|
|
|
%{
|
|
|
|
#include <myinit.h>
|
|
|
|
#include "ExtrusionEntity.hpp"
|
2014-03-09 19:19:30 +00:00
|
|
|
#include "ExtrusionEntityCollection.hpp"
|
2013-07-15 10:14:22 +00:00
|
|
|
%}
|
|
|
|
|
|
|
|
%name{Slic3r::ExtrusionPath} class ExtrusionPath {
|
|
|
|
~ExtrusionPath();
|
|
|
|
SV* arrayref()
|
2013-09-09 20:27:58 +00:00
|
|
|
%code{% RETVAL = THIS->polyline.to_AV(); %};
|
2013-07-15 20:57:22 +00:00
|
|
|
SV* pp()
|
|
|
|
%code{% RETVAL = THIS->polyline.to_SV_pureperl(); %};
|
2013-07-15 10:14:22 +00:00
|
|
|
void pop_back()
|
|
|
|
%code{% THIS->polyline.points.pop_back(); %};
|
|
|
|
void reverse();
|
2013-07-16 15:13:01 +00:00
|
|
|
Lines lines()
|
2013-09-13 13:19:15 +00:00
|
|
|
%code{% RETVAL = THIS->polyline.lines(); %};
|
2013-08-26 21:42:00 +00:00
|
|
|
Point* first_point()
|
2013-09-03 17:26:58 +00:00
|
|
|
%code{% const char* CLASS = "Slic3r::Point"; RETVAL = THIS->first_point(); %};
|
2013-08-28 23:36:42 +00:00
|
|
|
Point* last_point()
|
2013-09-03 17:26:58 +00:00
|
|
|
%code{% const char* CLASS = "Slic3r::Point"; RETVAL = THIS->last_point(); %};
|
2013-11-21 17:03:40 +00:00
|
|
|
void clip_end(double distance);
|
2013-11-21 19:25:24 +00:00
|
|
|
void simplify(double tolerance);
|
2013-11-21 17:03:40 +00:00
|
|
|
double length();
|
|
|
|
bool is_perimeter();
|
|
|
|
bool is_fill();
|
|
|
|
bool is_bridge();
|
2013-07-15 10:14:22 +00:00
|
|
|
%{
|
|
|
|
|
|
|
|
ExtrusionPath*
|
2014-01-03 17:27:46 +00:00
|
|
|
_new(CLASS, polyline_sv, role, mm3_per_mm)
|
2013-07-15 10:14:22 +00:00
|
|
|
char* CLASS;
|
|
|
|
SV* polyline_sv;
|
|
|
|
ExtrusionRole role;
|
2014-01-03 17:27:46 +00:00
|
|
|
double mm3_per_mm;
|
2013-07-15 10:14:22 +00:00
|
|
|
CODE:
|
|
|
|
RETVAL = new ExtrusionPath ();
|
2013-07-15 18:31:43 +00:00
|
|
|
RETVAL->polyline.from_SV_check(polyline_sv);
|
2013-07-15 10:14:22 +00:00
|
|
|
RETVAL->role = role;
|
2014-01-03 17:27:46 +00:00
|
|
|
RETVAL->mm3_per_mm = mm3_per_mm;
|
2013-07-15 10:14:22 +00:00
|
|
|
OUTPUT:
|
|
|
|
RETVAL
|
|
|
|
|
2013-07-16 07:49:34 +00:00
|
|
|
Polyline*
|
|
|
|
ExtrusionPath::polyline(...)
|
|
|
|
PREINIT:
|
2013-08-30 22:50:03 +00:00
|
|
|
const char* CLASS = "Slic3r::Polyline::Ref";
|
2013-07-16 07:49:34 +00:00
|
|
|
CODE:
|
|
|
|
if (items > 1) {
|
|
|
|
THIS->polyline.from_SV_check( ST(1) );
|
|
|
|
}
|
2013-08-30 22:50:03 +00:00
|
|
|
RETVAL = &(THIS->polyline);
|
2013-07-16 07:49:34 +00:00
|
|
|
OUTPUT:
|
|
|
|
RETVAL
|
|
|
|
|
2013-07-15 10:14:22 +00:00
|
|
|
ExtrusionRole
|
|
|
|
ExtrusionPath::role(...)
|
|
|
|
CODE:
|
|
|
|
if (items > 1) {
|
|
|
|
THIS->role = (ExtrusionRole)SvUV(ST(1));
|
|
|
|
}
|
|
|
|
RETVAL = THIS->role;
|
|
|
|
OUTPUT:
|
|
|
|
RETVAL
|
|
|
|
|
|
|
|
double
|
2014-01-03 17:27:46 +00:00
|
|
|
ExtrusionPath::mm3_per_mm(...)
|
2013-07-15 10:14:22 +00:00
|
|
|
CODE:
|
|
|
|
if (items > 1) {
|
2014-01-03 17:27:46 +00:00
|
|
|
THIS->mm3_per_mm = (double)SvNV(ST(1));
|
2013-07-15 10:14:22 +00:00
|
|
|
}
|
2014-01-03 17:27:46 +00:00
|
|
|
RETVAL = THIS->mm3_per_mm;
|
2013-07-15 10:14:22 +00:00
|
|
|
OUTPUT:
|
|
|
|
RETVAL
|
|
|
|
|
|
|
|
void
|
|
|
|
ExtrusionPath::append(...)
|
|
|
|
CODE:
|
|
|
|
for (unsigned int i = 1; i < items; i++) {
|
|
|
|
Point p;
|
2013-07-15 20:57:22 +00:00
|
|
|
p.from_SV_check(ST(i));
|
2013-07-15 10:14:22 +00:00
|
|
|
THIS->polyline.points.push_back(p);
|
|
|
|
}
|
|
|
|
|
2014-03-09 19:19:30 +00:00
|
|
|
ExtrusionEntityCollection*
|
|
|
|
ExtrusionPath::intersect_expolygons(ExPolygonCollection* collection)
|
|
|
|
PREINIT:
|
|
|
|
const char* CLASS = "Slic3r::ExtrusionPath::Collection";
|
|
|
|
CODE:
|
|
|
|
RETVAL = new ExtrusionEntityCollection ();
|
|
|
|
THIS->intersect_expolygons(*collection, RETVAL);
|
|
|
|
OUTPUT:
|
|
|
|
RETVAL
|
|
|
|
|
|
|
|
ExtrusionEntityCollection*
|
|
|
|
ExtrusionPath::subtract_expolygons(ExPolygonCollection* collection)
|
|
|
|
PREINIT:
|
|
|
|
const char* CLASS = "Slic3r::ExtrusionPath::Collection";
|
|
|
|
CODE:
|
|
|
|
RETVAL = new ExtrusionEntityCollection ();
|
|
|
|
THIS->subtract_expolygons(*collection, RETVAL);
|
|
|
|
OUTPUT:
|
|
|
|
RETVAL
|
|
|
|
|
2013-07-15 10:14:22 +00:00
|
|
|
%}
|
|
|
|
};
|
|
|
|
|
|
|
|
%package{Slic3r::ExtrusionPath};
|
|
|
|
%{
|
|
|
|
|
|
|
|
IV
|
|
|
|
_constant()
|
|
|
|
ALIAS:
|
|
|
|
EXTR_ROLE_PERIMETER = erPerimeter
|
|
|
|
EXTR_ROLE_EXTERNAL_PERIMETER = erExternalPerimeter
|
|
|
|
EXTR_ROLE_OVERHANG_PERIMETER = erOverhangPerimeter
|
|
|
|
EXTR_ROLE_CONTOUR_INTERNAL_PERIMETER = erContourInternalPerimeter
|
|
|
|
EXTR_ROLE_FILL = erFill
|
|
|
|
EXTR_ROLE_SOLIDFILL = erSolidFill
|
|
|
|
EXTR_ROLE_TOPSOLIDFILL = erTopSolidFill
|
|
|
|
EXTR_ROLE_BRIDGE = erBrige
|
|
|
|
EXTR_ROLE_INTERNALBRIDGE = erInternalBridge
|
|
|
|
EXTR_ROLE_SKIRT = erSkirt
|
|
|
|
EXTR_ROLE_SUPPORTMATERIAL = erSupportMaterial
|
|
|
|
EXTR_ROLE_GAPFILL = erGapFill
|
|
|
|
PROTOTYPE:
|
|
|
|
CODE:
|
|
|
|
RETVAL = ix;
|
|
|
|
OUTPUT: RETVAL
|
|
|
|
|
|
|
|
%}
|
|
|
|
|