Ported Slic3r::BridgeDetector to XS

This commit is contained in:
Alessandro Ranellucci 2014-11-15 22:41:22 +01:00
parent 36825e0134
commit 379cde30e2
22 changed files with 539 additions and 307 deletions

37
xs/xsp/BridgeDetector.xsp Normal file
View file

@ -0,0 +1,37 @@
%module{Slic3r::XS};
%{
#include <myinit.h>
#include "libslic3r/BridgeDetector.hpp"
%}
%name{Slic3r::BridgeDetector} class BridgeDetector {
~BridgeDetector();
bool detect_angle();
Polygons coverage()
%code{% THIS->coverage(&RETVAL); %};
Polygons coverage_by_angle(double angle)
%code{% THIS->coverage(angle, &RETVAL); %};
Polylines unsupported_edges()
%code{% THIS->unsupported_edges(&RETVAL); %};
Polylines unsupported_edges_by_angle(double angle)
%code{% THIS->unsupported_edges(angle, &RETVAL); %};
double angle()
%code{% RETVAL = THIS->angle; %};
double resolution()
%code{% RETVAL = THIS->resolution; %};
%{
BridgeDetector*
BridgeDetector::new(expolygon, lower_slices, extrusion_width)
ExPolygon* expolygon;
ExPolygonCollection* lower_slices;
long extrusion_width;
CODE:
RETVAL = new BridgeDetector(*expolygon, *lower_slices, extrusion_width);
OUTPUT:
RETVAL
%}
};

View file

@ -55,4 +55,28 @@ chained_path_from(points, start_from)
OUTPUT:
RETVAL
double
rad2deg(angle)
double angle
CODE:
RETVAL = Slic3r::Geometry::rad2deg(angle);
OUTPUT:
RETVAL
double
rad2deg_dir(angle)
double angle
CODE:
RETVAL = Slic3r::Geometry::rad2deg_dir(angle);
OUTPUT:
RETVAL
double
deg2rad(angle)
double angle
CODE:
RETVAL = Slic3r::Geometry::deg2rad(angle);
OUTPUT:
RETVAL
%}

View file

@ -165,6 +165,10 @@ GCodeWriter* O_OBJECT_SLIC3R
Ref<GCodeWriter> O_OBJECT_SLIC3R_T
Clone<GCodeWriter> O_OBJECT_SLIC3R_T
BridgeDetector* O_OBJECT_SLIC3R
Ref<BridgeDetector> O_OBJECT_SLIC3R_T
Clone<BridgeDetector> O_OBJECT_SLIC3R_T
ExtrusionLoopRole T_UV
ExtrusionRole T_UV
FlowRole T_UV

View file

@ -87,6 +87,9 @@
%typemap{GCodeWriter*};
%typemap{Ref<GCodeWriter>}{simple};
%typemap{Clone<GCodeWriter>}{simple};
%typemap{BridgeDetector*};
%typemap{Ref<BridgeDetector>}{simple};
%typemap{Clone<BridgeDetector>}{simple};
%typemap{Surface*};
%typemap{Ref<Surface>}{simple};