2013-07-15 14:21:09 +00:00
|
|
|
%module{Slic3r::XS};
|
|
|
|
|
|
|
|
%{
|
|
|
|
#include <myinit.h>
|
|
|
|
#include "ExtrusionEntity.hpp"
|
2014-04-27 17:18:53 +00:00
|
|
|
#include "perlglue.hpp"
|
2013-07-15 14:21:09 +00:00
|
|
|
%}
|
|
|
|
|
|
|
|
%name{Slic3r::ExtrusionLoop} class ExtrusionLoop {
|
|
|
|
~ExtrusionLoop();
|
|
|
|
SV* arrayref()
|
2014-05-07 10:02:09 +00:00
|
|
|
%code{% Polygon polygon; THIS->polygon(&polygon); RETVAL = polygon.to_AV(); %};
|
2013-07-15 20:57:22 +00:00
|
|
|
SV* pp()
|
2014-05-07 10:02:09 +00:00
|
|
|
%code{% Polygon polygon; THIS->polygon(&polygon); RETVAL = polygon.to_SV_pureperl(); %};
|
|
|
|
void reverse();
|
|
|
|
ExtrusionPath* split_at_index(int index)
|
|
|
|
%code{% RETVAL = new ExtrusionPath (); THIS->split_at_index(index, RETVAL); %};
|
|
|
|
ExtrusionPath* split_at_first_point()
|
|
|
|
%code{% RETVAL = new ExtrusionPath (); THIS->split_at_first_point(RETVAL); %};
|
2013-08-28 23:40:42 +00:00
|
|
|
bool make_counter_clockwise();
|
2014-04-27 17:18:53 +00:00
|
|
|
Clone<Point> first_point();
|
|
|
|
Clone<Point> last_point();
|
2013-11-21 17:03:40 +00:00
|
|
|
bool is_perimeter();
|
|
|
|
bool is_fill();
|
|
|
|
bool is_bridge();
|
2013-07-15 14:21:09 +00:00
|
|
|
%{
|
|
|
|
|
|
|
|
ExtrusionLoop*
|
2014-04-29 21:15:36 +00:00
|
|
|
_new(CLASS, polygon_sv, role, mm3_per_mm, width, height)
|
2013-07-15 14:21:09 +00:00
|
|
|
char* CLASS;
|
|
|
|
SV* polygon_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 14:21:09 +00:00
|
|
|
CODE:
|
2014-05-07 10:02:09 +00:00
|
|
|
Polygon polygon;
|
|
|
|
polygon.from_SV_check(polygon_sv);
|
|
|
|
RETVAL = new ExtrusionLoop (polygon, role);
|
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 14:21:09 +00:00
|
|
|
OUTPUT:
|
|
|
|
RETVAL
|
|
|
|
|
2014-05-07 10:02:09 +00:00
|
|
|
Polygon*
|
2013-07-16 07:49:34 +00:00
|
|
|
ExtrusionLoop::polygon(...)
|
|
|
|
CODE:
|
|
|
|
if (items > 1) {
|
2014-05-07 10:02:09 +00:00
|
|
|
Polygon polygon;
|
|
|
|
polygon.from_SV_check( ST(1) );
|
|
|
|
THIS->set_polygon(polygon);
|
2013-07-16 07:49:34 +00:00
|
|
|
}
|
2014-05-07 10:02:09 +00:00
|
|
|
RETVAL = new Polygon ();
|
|
|
|
THIS->polygon(RETVAL);
|
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
|
2014-01-03 17:27:46 +00:00
|
|
|
ExtrusionLoop::mm3_per_mm(...)
|
2013-07-15 14:21:09 +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 14:21:09 +00:00
|
|
|
}
|
2014-01-03 17:27:46 +00:00
|
|
|
RETVAL = THIS->mm3_per_mm;
|
2013-07-15 14:21:09 +00:00
|
|
|
OUTPUT:
|
|
|
|
RETVAL
|
|
|
|
|
2014-04-29 21:15:36 +00:00
|
|
|
float
|
|
|
|
ExtrusionLoop::width(...)
|
|
|
|
CODE:
|
|
|
|
if (items > 1) {
|
|
|
|
THIS->width = (float)SvNV(ST(1));
|
|
|
|
}
|
|
|
|
RETVAL = THIS->width;
|
|
|
|
OUTPUT:
|
|
|
|
RETVAL
|
|
|
|
|
|
|
|
float
|
|
|
|
ExtrusionLoop::height(...)
|
|
|
|
CODE:
|
|
|
|
if (items > 1) {
|
|
|
|
THIS->height = (float)SvNV(ST(1));
|
|
|
|
}
|
|
|
|
RETVAL = THIS->height;
|
|
|
|
OUTPUT:
|
|
|
|
RETVAL
|
|
|
|
|
2013-07-15 14:21:09 +00:00
|
|
|
%}
|
|
|
|
};
|