2013-07-15 10:14:22 +00:00
|
|
|
%module{Slic3r::XS};
|
|
|
|
|
|
|
|
%{
|
|
|
|
#include <myinit.h>
|
|
|
|
#include "ExtrusionEntity.hpp"
|
|
|
|
%}
|
|
|
|
|
|
|
|
%name{Slic3r::ExtrusionPath} class ExtrusionPath {
|
|
|
|
~ExtrusionPath();
|
|
|
|
SV* arrayref()
|
2013-07-15 20:57:22 +00:00
|
|
|
%code{% RETVAL = THIS->polyline.to_SV(); %};
|
|
|
|
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()
|
|
|
|
%code{% RETVAL = THIS->polyline.lines(); %};
|
2013-08-26 21:42:00 +00:00
|
|
|
Point* first_point()
|
|
|
|
%code{% const char* CLASS = "Slic3r::Point"; RETVAL = new Point(*(THIS->first_point())); %};
|
2013-07-15 10:14:22 +00:00
|
|
|
%{
|
|
|
|
|
|
|
|
ExtrusionPath*
|
|
|
|
_new(CLASS, polyline_sv, role, height, flow_spacing)
|
|
|
|
char* CLASS;
|
|
|
|
SV* polyline_sv;
|
|
|
|
ExtrusionRole role;
|
|
|
|
double height;
|
|
|
|
double flow_spacing;
|
|
|
|
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;
|
|
|
|
RETVAL->height = height;
|
|
|
|
RETVAL->flow_spacing = flow_spacing;
|
|
|
|
OUTPUT:
|
|
|
|
RETVAL
|
|
|
|
|
2013-07-16 07:49:34 +00:00
|
|
|
Polyline*
|
|
|
|
ExtrusionPath::polyline(...)
|
|
|
|
PREINIT:
|
|
|
|
const char* CLASS = "Slic3r::Polyline";
|
|
|
|
CODE:
|
|
|
|
if (items > 1) {
|
|
|
|
THIS->polyline.from_SV_check( ST(1) );
|
|
|
|
}
|
|
|
|
RETVAL = new Polyline(THIS->polyline);
|
|
|
|
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
|
|
|
|
ExtrusionPath::height(...)
|
|
|
|
CODE:
|
|
|
|
if (items > 1) {
|
|
|
|
THIS->height = (double)SvNV(ST(1));
|
|
|
|
}
|
|
|
|
RETVAL = THIS->height;
|
|
|
|
OUTPUT:
|
|
|
|
RETVAL
|
|
|
|
|
|
|
|
double
|
|
|
|
ExtrusionPath::flow_spacing(...)
|
|
|
|
CODE:
|
|
|
|
if (items > 1) {
|
|
|
|
THIS->flow_spacing = (double)SvNV(ST(1));
|
|
|
|
}
|
|
|
|
RETVAL = THIS->flow_spacing;
|
|
|
|
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);
|
|
|
|
}
|
|
|
|
|
|
|
|
%}
|
|
|
|
};
|
|
|
|
|
|
|
|
%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
|
|
|
|
|
|
|
|
%}
|
|
|
|
|