2013-07-15 14:21:09 +00:00
|
|
|
%module{Slic3r::XS};
|
|
|
|
|
|
|
|
%{
|
|
|
|
#include <myinit.h>
|
|
|
|
#include "ExtrusionEntity.hpp"
|
|
|
|
%}
|
|
|
|
|
|
|
|
%name{Slic3r::ExtrusionLoop} class ExtrusionLoop {
|
|
|
|
~ExtrusionLoop();
|
|
|
|
SV* arrayref()
|
2013-07-15 20:57:22 +00:00
|
|
|
%code{% RETVAL = THIS->polygon.to_SV(); %};
|
|
|
|
SV* pp()
|
|
|
|
%code{% RETVAL = THIS->polygon.to_SV_pureperl(); %};
|
2013-07-16 15:13:01 +00:00
|
|
|
void reverse()
|
|
|
|
%code{% THIS->polygon.reverse(); %};
|
2013-07-15 21:56:01 +00:00
|
|
|
ExtrusionPath* split_at_index(int index)
|
|
|
|
%code{% const char* CLASS = "Slic3r::ExtrusionPath"; RETVAL = THIS->split_at_index(index); %};
|
|
|
|
ExtrusionPath* split_at_first_point()
|
|
|
|
%code{% const char* CLASS = "Slic3r::ExtrusionPath"; RETVAL = THIS->split_at_first_point(); %};
|
2013-08-28 23:40:42 +00:00
|
|
|
bool make_counter_clockwise();
|
2013-07-15 14:21:09 +00:00
|
|
|
%{
|
|
|
|
|
|
|
|
ExtrusionLoop*
|
|
|
|
_new(CLASS, polygon_sv, role, height, flow_spacing)
|
|
|
|
char* CLASS;
|
|
|
|
SV* polygon_sv;
|
|
|
|
ExtrusionRole role;
|
|
|
|
double height;
|
|
|
|
double flow_spacing;
|
|
|
|
CODE:
|
|
|
|
RETVAL = new ExtrusionLoop ();
|
2013-07-15 18:31:43 +00:00
|
|
|
RETVAL->polygon.from_SV_check(polygon_sv);
|
2013-07-15 14:21:09 +00:00
|
|
|
RETVAL->role = role;
|
|
|
|
RETVAL->height = height;
|
|
|
|
RETVAL->flow_spacing = flow_spacing;
|
|
|
|
OUTPUT:
|
|
|
|
RETVAL
|
|
|
|
|
2013-07-16 07:49:34 +00:00
|
|
|
Polygon*
|
|
|
|
ExtrusionLoop::polygon(...)
|
|
|
|
PREINIT:
|
2013-08-30 22:50:03 +00:00
|
|
|
const char* CLASS = "Slic3r::Polygon::Ref";
|
2013-07-16 07:49:34 +00:00
|
|
|
CODE:
|
|
|
|
if (items > 1) {
|
|
|
|
THIS->polygon.from_SV_check( ST(1) );
|
|
|
|
}
|
2013-08-30 22:50:03 +00:00
|
|
|
RETVAL = &(THIS->polygon);
|
2013-07-16 07:49:34 +00:00
|
|
|
OUTPUT:
|
|
|
|
RETVAL
|
|
|
|
|
2013-07-15 14:21:09 +00:00
|
|
|
ExtrusionRole
|
|
|
|
ExtrusionLoop::role(...)
|
|
|
|
CODE:
|
|
|
|
if (items > 1) {
|
|
|
|
THIS->role = (ExtrusionRole)SvUV(ST(1));
|
|
|
|
}
|
|
|
|
RETVAL = THIS->role;
|
|
|
|
OUTPUT:
|
|
|
|
RETVAL
|
|
|
|
|
|
|
|
double
|
|
|
|
ExtrusionLoop::height(...)
|
|
|
|
CODE:
|
|
|
|
if (items > 1) {
|
|
|
|
THIS->height = (double)SvNV(ST(1));
|
|
|
|
}
|
|
|
|
RETVAL = THIS->height;
|
|
|
|
OUTPUT:
|
|
|
|
RETVAL
|
|
|
|
|
|
|
|
double
|
|
|
|
ExtrusionLoop::flow_spacing(...)
|
|
|
|
CODE:
|
|
|
|
if (items > 1) {
|
|
|
|
THIS->flow_spacing = (double)SvNV(ST(1));
|
|
|
|
}
|
|
|
|
RETVAL = THIS->flow_spacing;
|
|
|
|
OUTPUT:
|
|
|
|
RETVAL
|
|
|
|
|
|
|
|
%}
|
|
|
|
};
|