PrusaSlicer-NonPlainar/xs/xsp/ExtrusionLoop.xsp

47 lines
1.2 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();
2013-07-15 14:21:09 +00:00
~ExtrusionLoop();
Clone<ExtrusionLoop> clone()
%code{% RETVAL = THIS; %};
void reverse();
bool make_clockwise();
bool make_counter_clockwise();
Clone<Point> first_point();
Clone<Point> last_point();
Polygon* polygon()
%code{% RETVAL = new Polygon (*THIS); %};
void append(ExtrusionPath* path)
%code{% THIS->paths.push_back(*path); %};
double length();
void split_at(Point* point)
%code{% THIS->split_at(*point); %};
ExtrusionPaths clip_end(double distance)
%code{% THIS->clip_end(distance, &RETVAL); %};
bool has_overhang_point(Point* point)
%code{% RETVAL = THIS->has_overhang_point(*point); %};
2013-07-15 14:21:09 +00:00
%{
SV*
ExtrusionLoop::arrayref()
2013-07-15 14:21:09 +00:00
CODE:
AV* av = newAV();
av_fill(av, THIS->paths.size()-1);
int i = 0;
for (ExtrusionPaths::iterator it = THIS->paths.begin(); it != THIS->paths.end(); ++it) {
av_store(av, i++, it->to_SV_ref());
}
RETVAL = newRV_noinc((SV*)av);
OUTPUT:
RETVAL
2013-07-15 14:21:09 +00:00
%}
};