Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/supermerill/SuperSlicer.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlessandro Ranellucci <aar@cpan.org>2013-07-15 14:14:22 +0400
committerAlessandro Ranellucci <aar@cpan.org>2013-07-15 14:14:22 +0400
commitf612d4c64e727b028e5291414b8a5b4da72e87b4 (patch)
tree285276ad332204643855028033a18e759b3fdce3 /xs/xsp/Polygon.xsp
parent8c1e1cc3ea07a0a2a8379e058a035a8b8bd0c855 (diff)
Ported ExtrusionPath to XS. Failing test for Surface
Diffstat (limited to 'xs/xsp/Polygon.xsp')
-rw-r--r--xs/xsp/Polygon.xsp29
1 files changed, 29 insertions, 0 deletions
diff --git a/xs/xsp/Polygon.xsp b/xs/xsp/Polygon.xsp
new file mode 100644
index 000000000..daffd819c
--- /dev/null
+++ b/xs/xsp/Polygon.xsp
@@ -0,0 +1,29 @@
+%module{Slic3r::XS};
+
+%{
+#include <myinit.h>
+#include "Polygon.hpp"
+%}
+
+%name{Slic3r::Polygon::XS} class Polygon {
+ ~Polygon();
+ Polygon* clone()
+ %code{% const char* CLASS = "Slic3r::Polygon::XS"; RETVAL = new Polygon(*THIS); %};
+ SV* arrayref()
+ %code{% RETVAL = polygon2perl(*THIS); %};
+%{
+
+Polygon*
+Polygon::new(...)
+ CODE:
+ RETVAL = new Polygon ();
+ // ST(0) is class name, ST(1) is first point
+ RETVAL->points.resize(items-1);
+ for (unsigned int i = 1; i < items; i++) {
+ perl2point(ST(i), RETVAL->points[i-1]);
+ }
+ OUTPUT:
+ RETVAL
+
+%}
+};