2013-07-15 10:14:22 +00:00
|
|
|
%module{Slic3r::XS};
|
|
|
|
|
|
|
|
%{
|
2015-12-07 23:39:54 +00:00
|
|
|
#include <xsinit.h>
|
2014-08-03 17:42:29 +00:00
|
|
|
#include "libslic3r/ExtrusionEntity.hpp"
|
|
|
|
#include "libslic3r/ExtrusionEntityCollection.hpp"
|
2013-07-15 10:14:22 +00:00
|
|
|
%}
|
|
|
|
|
|
|
|
%name{Slic3r::ExtrusionPath} class ExtrusionPath {
|
|
|
|
~ExtrusionPath();
|
|
|
|
SV* arrayref()
|
2015-12-07 23:39:54 +00:00
|
|
|
%code{% RETVAL = to_AV(&THIS->polyline); %};
|
2013-07-15 20:57:22 +00:00
|
|
|
SV* pp()
|
2015-12-07 23:39:54 +00:00
|
|
|
%code{% RETVAL = to_SV_pureperl(&THIS->polyline); %};
|
2013-07-15 10:14:22 +00:00
|
|
|
void pop_back()
|
|
|
|
%code{% THIS->polyline.points.pop_back(); %};
|
|
|
|
void reverse();
|
2013-07-16 15:13:01 +00:00
|
|
|
Lines lines()
|
2013-09-13 13:19:15 +00:00
|
|
|
%code{% RETVAL = THIS->polyline.lines(); %};
|
2014-04-27 17:18:53 +00:00
|
|
|
Clone<Point> first_point();
|
|
|
|
Clone<Point> last_point();
|
2013-11-21 17:03:40 +00:00
|
|
|
void clip_end(double distance);
|
2013-11-21 19:25:24 +00:00
|
|
|
void simplify(double tolerance);
|
2013-11-21 17:03:40 +00:00
|
|
|
double length();
|
2017-04-07 15:37:30 +00:00
|
|
|
ExtrusionRole role() const;
|
2017-05-03 16:28:22 +00:00
|
|
|
bool is_bridge()
|
|
|
|
%code{% RETVAL = is_bridge(THIS->role()); %};
|
2016-11-03 23:10:35 +00:00
|
|
|
Polygons polygons_covered_by_width();
|
|
|
|
Polygons polygons_covered_by_spacing();
|
2013-07-15 10:14:22 +00:00
|
|
|
%{
|
|
|
|
|
|
|
|
ExtrusionPath*
|
2014-04-29 21:15:36 +00:00
|
|
|
_new(CLASS, polyline_sv, role, mm3_per_mm, width, height)
|
2013-07-15 10:14:22 +00:00
|
|
|
char* CLASS;
|
|
|
|
SV* polyline_sv;
|
|
|
|
ExtrusionRole role;
|
2014-01-03 17:27:46 +00:00
|
|
|
double mm3_per_mm;
|
2014-04-29 21:15:36 +00:00
|
|
|
float width;
|
|
|
|
float height;
|
2013-07-15 10:14:22 +00:00
|
|
|
CODE:
|
2014-05-12 19:49:17 +00:00
|
|
|
RETVAL = new ExtrusionPath (role);
|
2015-12-07 23:39:54 +00:00
|
|
|
from_SV_check(polyline_sv, &RETVAL->polyline);
|
2014-01-03 17:27:46 +00:00
|
|
|
RETVAL->mm3_per_mm = mm3_per_mm;
|
2014-04-29 21:15:36 +00:00
|
|
|
RETVAL->width = width;
|
|
|
|
RETVAL->height = height;
|
2013-07-15 10:14:22 +00:00
|
|
|
OUTPUT:
|
|
|
|
RETVAL
|
|
|
|
|
2014-04-27 17:18:53 +00:00
|
|
|
Ref<Polyline>
|
2013-07-16 07:49:34 +00:00
|
|
|
ExtrusionPath::polyline(...)
|
|
|
|
CODE:
|
|
|
|
if (items > 1) {
|
2015-12-07 23:39:54 +00:00
|
|
|
from_SV_check(ST(1), &THIS->polyline);
|
2013-07-16 07:49:34 +00:00
|
|
|
}
|
2013-08-30 22:50:03 +00:00
|
|
|
RETVAL = &(THIS->polyline);
|
2013-07-16 07:49:34 +00:00
|
|
|
OUTPUT:
|
|
|
|
RETVAL
|
|
|
|
|
2013-07-15 10:14:22 +00:00
|
|
|
double
|
2014-01-03 17:27:46 +00:00
|
|
|
ExtrusionPath::mm3_per_mm(...)
|
2013-07-15 10:14:22 +00:00
|
|
|
CODE:
|
|
|
|
if (items > 1) {
|
2014-01-03 17:27:46 +00:00
|
|
|
THIS->mm3_per_mm = (double)SvNV(ST(1));
|
2013-07-15 10:14:22 +00:00
|
|
|
}
|
2014-01-03 17:27:46 +00:00
|
|
|
RETVAL = THIS->mm3_per_mm;
|
2013-07-15 10:14:22 +00:00
|
|
|
OUTPUT:
|
|
|
|
RETVAL
|
|
|
|
|
2014-04-29 21:15:36 +00:00
|
|
|
float
|
|
|
|
ExtrusionPath::width(...)
|
|
|
|
CODE:
|
|
|
|
if (items > 1) {
|
|
|
|
THIS->width = (float)SvNV(ST(1));
|
|
|
|
}
|
|
|
|
RETVAL = THIS->width;
|
|
|
|
OUTPUT:
|
|
|
|
RETVAL
|
|
|
|
|
|
|
|
float
|
|
|
|
ExtrusionPath::height(...)
|
|
|
|
CODE:
|
|
|
|
if (items > 1) {
|
|
|
|
THIS->height = (float)SvNV(ST(1));
|
|
|
|
}
|
|
|
|
RETVAL = THIS->height;
|
|
|
|
OUTPUT:
|
|
|
|
RETVAL
|
|
|
|
|
2013-07-15 10:14:22 +00:00
|
|
|
void
|
|
|
|
ExtrusionPath::append(...)
|
|
|
|
CODE:
|
|
|
|
for (unsigned int i = 1; i < items; i++) {
|
|
|
|
Point p;
|
2015-12-07 23:39:54 +00:00
|
|
|
from_SV_check(ST(i), &p);
|
2013-07-15 10:14:22 +00:00
|
|
|
THIS->polyline.points.push_back(p);
|
|
|
|
}
|
|
|
|
|
2014-03-09 19:19:30 +00:00
|
|
|
ExtrusionEntityCollection*
|
|
|
|
ExtrusionPath::intersect_expolygons(ExPolygonCollection* collection)
|
|
|
|
CODE:
|
|
|
|
RETVAL = new ExtrusionEntityCollection ();
|
|
|
|
THIS->intersect_expolygons(*collection, RETVAL);
|
|
|
|
OUTPUT:
|
|
|
|
RETVAL
|
|
|
|
|
|
|
|
ExtrusionEntityCollection*
|
|
|
|
ExtrusionPath::subtract_expolygons(ExPolygonCollection* collection)
|
|
|
|
CODE:
|
|
|
|
RETVAL = new ExtrusionEntityCollection ();
|
|
|
|
THIS->subtract_expolygons(*collection, RETVAL);
|
|
|
|
OUTPUT:
|
|
|
|
RETVAL
|
|
|
|
|
2013-07-15 10:14:22 +00:00
|
|
|
%}
|
|
|
|
};
|
|
|
|
|
|
|
|
%package{Slic3r::ExtrusionPath};
|
|
|
|
%{
|
|
|
|
|
|
|
|
IV
|
|
|
|
_constant()
|
|
|
|
ALIAS:
|
2015-07-02 12:29:20 +00:00
|
|
|
EXTR_ROLE_NONE = erNone
|
2013-07-15 10:14:22 +00:00
|
|
|
EXTR_ROLE_PERIMETER = erPerimeter
|
|
|
|
EXTR_ROLE_EXTERNAL_PERIMETER = erExternalPerimeter
|
|
|
|
EXTR_ROLE_OVERHANG_PERIMETER = erOverhangPerimeter
|
2014-05-12 19:49:17 +00:00
|
|
|
EXTR_ROLE_FILL = erInternalInfill
|
|
|
|
EXTR_ROLE_SOLIDFILL = erSolidInfill
|
|
|
|
EXTR_ROLE_TOPSOLIDFILL = erTopSolidInfill
|
|
|
|
EXTR_ROLE_BRIDGE = erBridgeInfill
|
|
|
|
EXTR_ROLE_GAPFILL = erGapFill
|
2013-07-15 10:14:22 +00:00
|
|
|
EXTR_ROLE_SKIRT = erSkirt
|
|
|
|
EXTR_ROLE_SUPPORTMATERIAL = erSupportMaterial
|
2014-05-12 20:59:49 +00:00
|
|
|
EXTR_ROLE_SUPPORTMATERIAL_INTERFACE = erSupportMaterialInterface
|
2017-04-07 15:37:30 +00:00
|
|
|
EXTR_ROLE_MIXED = erMixed
|
2013-07-15 10:14:22 +00:00
|
|
|
PROTOTYPE:
|
|
|
|
CODE:
|
|
|
|
RETVAL = ix;
|
|
|
|
OUTPUT: RETVAL
|
|
|
|
|
|
|
|
%}
|
|
|
|
|