PrusaSlicer-NonPlainar/xs/xsp/ExtrusionLoop.xsp

78 lines
2.0 KiB
Plaintext
Raw Normal View History

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()
%code{% RETVAL = THIS->polygon.to_AV(); %};
SV* pp()
%code{% RETVAL = THIS->polygon.to_SV_pureperl(); %};
2013-07-16 15:13:01 +00:00
void reverse()
%code{% THIS->polygon.reverse(); %};
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(); %};
bool make_counter_clockwise();
Point* first_point()
%code{% const char* CLASS = "Slic3r::Point"; RETVAL = THIS->first_point(); %};
Point* last_point()
%code{% const char* CLASS = "Slic3r::Point"; RETVAL = THIS->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)
2013-07-15 14:21:09 +00:00
char* CLASS;
SV* polygon_sv;
ExtrusionRole role;
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;
RETVAL->mm3_per_mm = mm3_per_mm;
2013-07-15 14:21:09 +00:00
OUTPUT:
RETVAL
Polygon*
ExtrusionLoop::polygon(...)
PREINIT:
const char* CLASS = "Slic3r::Polygon::Ref";
CODE:
if (items > 1) {
THIS->polygon.from_SV_check( ST(1) );
}
RETVAL = &(THIS->polygon);
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
%}
};