2013-07-15 20:57:22 +00:00
|
|
|
%module{Slic3r::XS};
|
|
|
|
|
|
|
|
%{
|
|
|
|
#include <myinit.h>
|
|
|
|
#include "Line.hpp"
|
|
|
|
%}
|
|
|
|
|
|
|
|
%name{Slic3r::Line} class Line {
|
|
|
|
~Line();
|
|
|
|
Line* clone()
|
|
|
|
%code{% const char* CLASS = "Slic3r::Line"; RETVAL = new Line(*THIS); %};
|
|
|
|
SV* arrayref()
|
2013-09-09 20:27:58 +00:00
|
|
|
%code{% RETVAL = THIS->to_AV(); %};
|
2013-07-15 20:57:22 +00:00
|
|
|
SV* pp()
|
|
|
|
%code{% RETVAL = THIS->to_SV_pureperl(); %};
|
2013-07-16 07:49:34 +00:00
|
|
|
Point* a()
|
2013-09-02 18:22:20 +00:00
|
|
|
%code{% const char* CLASS = "Slic3r::Point::Ref"; RETVAL = &(THIS->a); %};
|
2013-07-16 07:49:34 +00:00
|
|
|
Point* b()
|
2013-09-02 18:22:20 +00:00
|
|
|
%code{% const char* CLASS = "Slic3r::Point::Ref"; RETVAL = &(THIS->b); %};
|
2013-07-15 20:57:22 +00:00
|
|
|
void reverse();
|
2013-07-16 15:13:01 +00:00
|
|
|
void scale(double factor);
|
|
|
|
void translate(double x, double y);
|
2013-08-28 18:32:25 +00:00
|
|
|
double length();
|
2013-08-28 23:36:42 +00:00
|
|
|
Point* midpoint()
|
|
|
|
%code{% const char* CLASS = "Slic3r::Point"; RETVAL = THIS->midpoint(); %};
|
2013-10-27 21:57:25 +00:00
|
|
|
Point* point_at(double distance)
|
|
|
|
%code{% const char* CLASS = "Slic3r::Point"; RETVAL = THIS->point_at(distance); %};
|
2013-11-21 13:15:38 +00:00
|
|
|
Polyline* as_polyline()
|
2013-11-21 14:12:06 +00:00
|
|
|
%code{% const char* CLASS = "Slic3r::Polyline"; RETVAL = new Polyline(*THIS); %};
|
2013-07-15 20:57:22 +00:00
|
|
|
%{
|
|
|
|
|
|
|
|
Line*
|
|
|
|
Line::new(...)
|
|
|
|
CODE:
|
|
|
|
RETVAL = new Line ();
|
|
|
|
// ST(0) is class name, ST(1) and ST(2) are endpoints
|
|
|
|
RETVAL->a.from_SV_check( ST(1) );
|
|
|
|
RETVAL->b.from_SV_check( ST(2) );
|
|
|
|
OUTPUT:
|
|
|
|
RETVAL
|
2013-07-16 15:13:01 +00:00
|
|
|
|
|
|
|
void
|
|
|
|
Line::rotate(angle, center_sv)
|
|
|
|
double angle;
|
|
|
|
SV* center_sv;
|
|
|
|
CODE:
|
|
|
|
Point center;
|
|
|
|
center.from_SV_check(center_sv);
|
|
|
|
THIS->rotate(angle, ¢er);
|
2013-07-15 20:57:22 +00:00
|
|
|
|
2013-11-06 18:38:10 +00:00
|
|
|
bool
|
|
|
|
Line::coincides_with(line_sv)
|
|
|
|
SV* line_sv;
|
|
|
|
CODE:
|
|
|
|
Line line;
|
|
|
|
line.from_SV_check(line_sv);
|
|
|
|
RETVAL = THIS->coincides_with(&line);
|
|
|
|
OUTPUT:
|
|
|
|
RETVAL
|
|
|
|
|
2013-07-15 20:57:22 +00:00
|
|
|
%}
|
|
|
|
};
|