2013-07-15 10:14:22 +00:00
|
|
|
%module{Slic3r::XS};
|
|
|
|
|
|
|
|
%{
|
|
|
|
#include <myinit.h>
|
2014-08-03 17:42:29 +00:00
|
|
|
#include "libslic3r/ExtrusionEntity.hpp"
|
|
|
|
#include "libslic3r/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(); %};
|
2014-04-27 17:18:53 +00:00
|
|
|
Clone<Point> first_point();
|
|
|
|
Clone<Point> 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();
|
2014-12-16 23:34:00 +00:00
|
|
|
bool is_infill();
|
|
|
|
bool is_solid_infill();
|
2013-11-21 17:03:40 +00:00
|
|
|
bool is_bridge();
|
2015-01-15 19:06:30 +00:00
|
|
|
Polygons grow();
|
2013-07-15 10:14:22 +00:00
|
|
|
%{
|
|
|
|
|
|
|
|
ExtrusionPath*
|
2014-04-29 21:15:36 +00:00
|
|
|
_new(CLASS, polyline_sv, role, mm3_per_mm, width, height)
|
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;
|
2014-04-29 21:15:36 +00:00
|
|
|
float width;
|
|
|
|
float height;
|
2013-07-15 10:14:22 +00:00
|
|
|
CODE:
|
2014-05-12 19:49:17 +00:00
|
|
|
RETVAL = new ExtrusionPath (role);
|
2013-07-15 18:31:43 +00:00
|
|
|
RETVAL->polyline.from_SV_check(polyline_sv);
|
2014-01-03 17:27:46 +00:00
|
|
|
RETVAL->mm3_per_mm = mm3_per_mm;
|
2014-04-29 21:15:36 +00:00
|
|
|
RETVAL->width = width;
|
|
|
|
RETVAL->height = height;
|
2013-07-15 10:14:22 +00:00
|
|
|
OUTPUT:
|
|
|
|
RETVAL
|
|
|
|
|
2014-04-27 17:18:53 +00:00
|
|
|
Ref<Polyline>
|
2013-07-16 07:49:34 +00:00
|
|
|
ExtrusionPath::polyline(...)
|
|
|
|
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
|
|
|
|
|
2014-04-29 21:15:36 +00:00
|
|
|
float
|
|
|
|
ExtrusionPath::width(...)
|
|
|
|
CODE:
|
|
|
|
if (items > 1) {
|
|
|
|
THIS->width = (float)SvNV(ST(1));
|
|
|
|
}
|
|
|
|
RETVAL = THIS->width;
|
|
|
|
OUTPUT:
|
|
|
|
RETVAL
|
|
|
|
|
|
|
|
float
|
|
|
|
ExtrusionPath::height(...)
|
|
|
|
CODE:
|
|
|
|
if (items > 1) {
|
|
|
|
THIS->height = (float)SvNV(ST(1));
|
|
|
|
}
|
|
|
|
RETVAL = THIS->height;
|
|
|
|
OUTPUT:
|
|
|
|
RETVAL
|
|
|
|
|
2013-07-15 10:14:22 +00:00
|
|
|
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)
|
|
|
|
CODE:
|
|
|
|
RETVAL = new ExtrusionEntityCollection ();
|
|
|
|
THIS->intersect_expolygons(*collection, RETVAL);
|
|
|
|
OUTPUT:
|
|
|
|
RETVAL
|
|
|
|
|
|
|
|
ExtrusionEntityCollection*
|
|
|
|
ExtrusionPath::subtract_expolygons(ExPolygonCollection* 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:
|
2015-07-02 12:29:20 +00:00
|
|
|
EXTR_ROLE_NONE = erNone
|
2013-07-15 10:14:22 +00:00
|
|
|
EXTR_ROLE_PERIMETER = erPerimeter
|
|
|
|
EXTR_ROLE_EXTERNAL_PERIMETER = erExternalPerimeter
|
|
|
|
EXTR_ROLE_OVERHANG_PERIMETER = erOverhangPerimeter
|
2014-05-12 19:49:17 +00:00
|
|
|
EXTR_ROLE_FILL = erInternalInfill
|
|
|
|
EXTR_ROLE_SOLIDFILL = erSolidInfill
|
|
|
|
EXTR_ROLE_TOPSOLIDFILL = erTopSolidInfill
|
|
|
|
EXTR_ROLE_BRIDGE = erBridgeInfill
|
|
|
|
EXTR_ROLE_GAPFILL = erGapFill
|
2013-07-15 10:14:22 +00:00
|
|
|
EXTR_ROLE_SKIRT = erSkirt
|
|
|
|
EXTR_ROLE_SUPPORTMATERIAL = erSupportMaterial
|
2014-05-12 20:59:49 +00:00
|
|
|
EXTR_ROLE_SUPPORTMATERIAL_INTERFACE = erSupportMaterialInterface
|
2013-07-15 10:14:22 +00:00
|
|
|
PROTOTYPE:
|
|
|
|
CODE:
|
|
|
|
RETVAL = ix;
|
|
|
|
OUTPUT: RETVAL
|
|
|
|
|
|
|
|
%}
|
|
|
|
|