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()
|
2013-09-09 20:27:58 +00:00
|
|
|
%code{% RETVAL = THIS->polygon.to_AV(); %};
|
2013-07-15 20:57:22 +00:00
|
|
|
SV* pp()
|
|
|
|
%code{% RETVAL = THIS->polygon.to_SV_pureperl(); %};
|
2013-07-16 15:13:01 +00:00
|
|
|
void reverse()
|
|
|
|
%code{% THIS->polygon.reverse(); %};
|
2014-04-27 17:18:53 +00:00
|
|
|
ExtrusionPath* split_at_index(int index);
|
|
|
|
ExtrusionPath* split_at_first_point();
|
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-01-03 17:27:46 +00:00
|
|
|
_new(CLASS, polygon_sv, role, mm3_per_mm)
|
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;
|
2013-07-15 14:21:09 +00:00
|
|
|
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;
|
2014-01-03 17:27:46 +00:00
|
|
|
RETVAL->mm3_per_mm = mm3_per_mm;
|
2013-07-15 14:21:09 +00:00
|
|
|
OUTPUT:
|
|
|
|
RETVAL
|
|
|
|
|
2014-04-27 17:18:53 +00:00
|
|
|
Ref<Polygon>
|
2013-07-16 07:49:34 +00:00
|
|
|
ExtrusionLoop::polygon(...)
|
|
|
|
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
|
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
|
|
|
|
|
|
|
|
%}
|
|
|
|
};
|