2013-07-06 16:33:49 +02:00
|
|
|
%module{Slic3r::XS};
|
|
|
|
|
|
|
|
%{
|
|
|
|
#include <myinit.h>
|
|
|
|
#include "ExPolygon.hpp"
|
|
|
|
%}
|
|
|
|
|
2013-07-15 22:57:22 +02:00
|
|
|
%name{Slic3r::ExPolygon} class ExPolygon {
|
2013-07-07 16:51:02 +02:00
|
|
|
~ExPolygon();
|
2013-07-14 13:11:01 +02:00
|
|
|
ExPolygon* clone()
|
2013-08-08 02:10:34 +02:00
|
|
|
%code{% const char* CLASS = "Slic3r::ExPolygon"; RETVAL = new ExPolygon(*THIS); %};
|
2013-07-14 00:38:01 +02:00
|
|
|
SV* arrayref()
|
2013-09-09 22:27:58 +02:00
|
|
|
%code{% RETVAL = THIS->to_AV(); %};
|
2013-07-15 22:57:22 +02:00
|
|
|
SV* pp()
|
|
|
|
%code{% RETVAL = THIS->to_SV_pureperl(); %};
|
2013-08-26 23:09:18 +02:00
|
|
|
Polygon* contour()
|
2013-09-02 20:22:20 +02:00
|
|
|
%code{% const char* CLASS = "Slic3r::Polygon::Ref"; RETVAL = &(THIS->contour); %};
|
|
|
|
Polygons* holes()
|
|
|
|
%code{% RETVAL = &(THIS->holes); %};
|
2013-07-11 14:08:11 +02:00
|
|
|
void scale(double factor);
|
2013-07-11 18:55:51 +02:00
|
|
|
void translate(double x, double y);
|
2013-08-26 22:50:26 +02:00
|
|
|
double area();
|
2013-08-26 23:27:51 +02:00
|
|
|
bool is_valid();
|
2013-11-21 15:12:06 +01:00
|
|
|
bool contains_line(Line* line);
|
2013-11-21 16:21:42 +01:00
|
|
|
bool contains_point(Point* point);
|
2013-11-22 02:16:10 +01:00
|
|
|
ExPolygons simplify(double tolerance);
|
|
|
|
Polygons simplify_p(double tolerance);
|
2013-07-06 16:33:49 +02:00
|
|
|
%{
|
|
|
|
|
|
|
|
ExPolygon*
|
|
|
|
ExPolygon::new(...)
|
|
|
|
CODE:
|
|
|
|
RETVAL = new ExPolygon ();
|
|
|
|
// ST(0) is class name, ST(1) is contour and others are holes
|
2013-07-15 20:31:43 +02:00
|
|
|
RETVAL->contour.from_SV_check(ST(1));
|
2013-07-07 16:51:02 +02:00
|
|
|
RETVAL->holes.resize(items-2);
|
2013-07-06 16:33:49 +02:00
|
|
|
for (unsigned int i = 2; i < items; i++) {
|
2013-07-15 20:31:43 +02:00
|
|
|
RETVAL->holes[i-2].from_SV_check(ST(i));
|
2013-07-06 16:33:49 +02:00
|
|
|
}
|
|
|
|
OUTPUT:
|
|
|
|
RETVAL
|
|
|
|
|
2013-07-14 16:03:06 +02:00
|
|
|
void
|
|
|
|
ExPolygon::rotate(angle, center_sv)
|
|
|
|
double angle;
|
|
|
|
SV* center_sv;
|
|
|
|
CODE:
|
2013-07-15 22:57:22 +02:00
|
|
|
Point center;
|
|
|
|
center.from_SV_check(center_sv);
|
|
|
|
THIS->rotate(angle, ¢er);
|
2013-07-14 16:03:06 +02:00
|
|
|
|
2013-07-06 16:33:49 +02:00
|
|
|
%}
|
|
|
|
};
|