PrusaSlicer-NonPlainar/xs/xsp/ExtrusionLoop.xsp

101 lines
2.4 KiB
Plaintext
Raw Normal View History

2013-07-15 14:21:09 +00:00
%module{Slic3r::XS};
%{
#include <myinit.h>
#include "ExtrusionEntity.hpp"
#include "perlglue.hpp"
2013-07-15 14:21:09 +00:00
%}
%name{Slic3r::ExtrusionLoop} class ExtrusionLoop {
~ExtrusionLoop();
SV* arrayref()
%code{% Polygon polygon; THIS->polygon(&polygon); RETVAL = polygon.to_AV(); %};
SV* pp()
%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); %};
bool make_counter_clockwise();
Clone<Point> first_point();
Clone<Point> last_point();
bool is_perimeter();
bool is_fill();
bool is_bridge();
2013-07-15 14:21:09 +00:00
%{
ExtrusionLoop*
_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;
double mm3_per_mm;
float width;
float height;
2013-07-15 14:21:09 +00:00
CODE:
Polygon polygon;
polygon.from_SV_check(polygon_sv);
RETVAL = new ExtrusionLoop (polygon, role);
RETVAL->mm3_per_mm = mm3_per_mm;
RETVAL->width = width;
RETVAL->height = height;
2013-07-15 14:21:09 +00:00
OUTPUT:
RETVAL
Polygon*
ExtrusionLoop::polygon(...)
CODE:
if (items > 1) {
Polygon polygon;
polygon.from_SV_check( ST(1) );
THIS->set_polygon(polygon);
}
RETVAL = new Polygon ();
THIS->polygon(RETVAL);
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::mm3_per_mm(...)
2013-07-15 14:21:09 +00:00
CODE:
if (items > 1) {
THIS->mm3_per_mm = (double)SvNV(ST(1));
2013-07-15 14:21:09 +00:00
}
RETVAL = THIS->mm3_per_mm;
2013-07-15 14:21:09 +00:00
OUTPUT:
RETVAL
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
%}
};