mirror of
https://github.com/QIDITECH/QIDISlicer.git
synced 2026-02-05 10:21:52 +03:00
QIDISlicer1.0.0
This commit is contained in:
74
xs/xsp/Polyline.xsp
Normal file
74
xs/xsp/Polyline.xsp
Normal file
@@ -0,0 +1,74 @@
|
||||
%module{Slic3r::XS};
|
||||
|
||||
%{
|
||||
#include <xsinit.h>
|
||||
#include "libslic3r/Polyline.hpp"
|
||||
%}
|
||||
|
||||
%name{Slic3r::Polyline} class Polyline {
|
||||
~Polyline();
|
||||
Clone<Polyline> clone()
|
||||
%code{% RETVAL = THIS; %};
|
||||
SV* arrayref()
|
||||
%code{% RETVAL = to_AV(THIS); %};
|
||||
SV* pp()
|
||||
%code{% RETVAL = to_SV_pureperl(THIS); %};
|
||||
void scale(double factor);
|
||||
void translate(double x, double y);
|
||||
void pop_back()
|
||||
%code{% THIS->points.pop_back(); %};
|
||||
void reverse();
|
||||
Lines lines();
|
||||
Clone<Point> first_point();
|
||||
Clone<Point> last_point();
|
||||
double length();
|
||||
bool is_valid();
|
||||
void clip_end(double distance);
|
||||
void clip_start(double distance);
|
||||
void extend_end(double distance);
|
||||
void extend_start(double distance);
|
||||
void simplify(double tolerance);
|
||||
void split_at(Point* point, Polyline* p1, Polyline* p2)
|
||||
%code{% THIS->split_at(*point, p1, p2); %};
|
||||
%{
|
||||
|
||||
Polyline*
|
||||
Polyline::new(...)
|
||||
CODE:
|
||||
RETVAL = new Polyline ();
|
||||
// ST(0) is class name, ST(1) is first point
|
||||
RETVAL->points.resize(items-1);
|
||||
for (unsigned int i = 1; i < items; i++) {
|
||||
from_SV_check(ST(i), &RETVAL->points[i-1]);
|
||||
}
|
||||
OUTPUT:
|
||||
RETVAL
|
||||
|
||||
void
|
||||
Polyline::append(...)
|
||||
CODE:
|
||||
for (unsigned int i = 1; i < items; i++) {
|
||||
Point p;
|
||||
from_SV_check(ST(i), &p);
|
||||
THIS->points.push_back(p);
|
||||
}
|
||||
|
||||
void
|
||||
Polyline::append_polyline(polyline)
|
||||
Polyline* polyline;
|
||||
CODE:
|
||||
for (Points::const_iterator it = polyline->points.begin(); it != polyline->points.end(); ++it) {
|
||||
THIS->points.push_back((*it));
|
||||
}
|
||||
|
||||
void
|
||||
Polyline::rotate(angle, center_sv)
|
||||
double angle;
|
||||
SV* center_sv;
|
||||
CODE:
|
||||
Point center;
|
||||
from_SV_check(center_sv, ¢er);
|
||||
THIS->rotate(angle, center);
|
||||
|
||||
%}
|
||||
};
|
||||
Reference in New Issue
Block a user