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

github.com/prusa3d/PrusaSlicer.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/xs/xsp
diff options
context:
space:
mode:
authorbubnikv <bubnikv@gmail.com>2016-09-12 17:25:15 +0300
committerbubnikv <bubnikv@gmail.com>2016-09-12 17:25:15 +0300
commitf518e0675c5672215c9543dae36a068f7c56b4c4 (patch)
treecd5c4574036d40392a376f6e547d22e190adacc6 /xs/xsp
parent73cbb4b5dceab3e39b0a5d92d27c1fe52f3b3116 (diff)
Initial commit of the new Pressure Equalizer, the EdgeGrid
signed distance field structure. The EdgeGrid is used to avoid placing the seams on overhangs.
Diffstat (limited to 'xs/xsp')
-rw-r--r--xs/xsp/Filler.xsp1
-rw-r--r--xs/xsp/GCode.xsp5
-rw-r--r--xs/xsp/GCodePressureEqualizer.xsp32
-rw-r--r--xs/xsp/my.map4
-rw-r--r--xs/xsp/typemap.xspt3
5 files changed, 45 insertions, 0 deletions
diff --git a/xs/xsp/Filler.xsp b/xs/xsp/Filler.xsp
index b7871664f..d03113bb1 100644
--- a/xs/xsp/Filler.xsp
+++ b/xs/xsp/Filler.xsp
@@ -3,6 +3,7 @@
%{
#include <xsinit.h>
#include "libslic3r/Fill/FillBase.hpp"
+#include "libslic3r/PolylineCollection.hpp"
%}
%name{Slic3r::Filler} class Filler {
diff --git a/xs/xsp/GCode.xsp b/xs/xsp/GCode.xsp
index 7f17a3a12..4ecee70a9 100644
--- a/xs/xsp/GCode.xsp
+++ b/xs/xsp/GCode.xsp
@@ -107,6 +107,11 @@
void set_enable_cooling_markers(bool value)
%code{% THIS->enable_cooling_markers = value; %};
+ bool enable_extrusion_role_markers()
+ %code{% RETVAL = THIS->enable_extrusion_role_markers; %};
+ void set_enable_extrusion_role_markers(bool value)
+ %code{% THIS->enable_extrusion_role_markers = value; %};
+
int layer_count()
%code{% RETVAL = THIS->layer_count; %};
void set_layer_count(int value)
diff --git a/xs/xsp/GCodePressureEqualizer.xsp b/xs/xsp/GCodePressureEqualizer.xsp
new file mode 100644
index 000000000..39372e0e0
--- /dev/null
+++ b/xs/xsp/GCodePressureEqualizer.xsp
@@ -0,0 +1,32 @@
+%module{Slic3r::XS};
+
+%{
+#include <xsinit.h>
+#include "libslic3r/GCode/PressureEqualizer.hpp"
+%}
+
+%name{Slic3r::GCode::PressureEqualizer} class GCodePressureEqualizer {
+ GCodePressureEqualizer(StaticPrintConfig* config)
+ %code%{ RETVAL = new GCodePressureEqualizer(dynamic_cast<GCodeConfig*>(config)); %};
+ ~GCodePressureEqualizer();
+
+ void reset();
+
+ // Process a next batch of G-code lines. Flush the internal buffers if asked for.
+// const char* process(const char *szGCode, bool flush);
+// std::string process(const char *szGCode, bool flush)
+// %code{% const char *out = THIS->process(szGCode, flush); RETVAL = (out == NULL) ? "" : std::string(out); %};
+
+%{
+
+SV*
+GCodePressureEqualizer::process(const char *szGCode, bool flush)
+ CODE:
+ const char *out = THIS->process(szGCode, flush);
+ RETVAL = newSVpv(out, THIS->get_output_buffer_length());
+ OUTPUT:
+ RETVAL
+
+%}
+
+};
diff --git a/xs/xsp/my.map b/xs/xsp/my.map
index 4d4d5d997..cca5649bf 100644
--- a/xs/xsp/my.map
+++ b/xs/xsp/my.map
@@ -209,6 +209,10 @@ GCodeWriter* O_OBJECT_SLIC3R
Ref<GCodeWriter> O_OBJECT_SLIC3R_T
Clone<GCodeWriter> O_OBJECT_SLIC3R_T
+GCodePressureEqualizer* O_OBJECT_SLIC3R
+Ref<GCodePressureEqualizer> O_OBJECT_SLIC3R_T
+Clone<GCodePressureEqualizer> O_OBJECT_SLIC3R_T
+
BridgeDetector* O_OBJECT_SLIC3R
Ref<BridgeDetector> O_OBJECT_SLIC3R_T
Clone<BridgeDetector> O_OBJECT_SLIC3R_T
diff --git a/xs/xsp/typemap.xspt b/xs/xsp/typemap.xspt
index 3453f0067..1c7d27a95 100644
--- a/xs/xsp/typemap.xspt
+++ b/xs/xsp/typemap.xspt
@@ -102,6 +102,9 @@
%typemap{GCodeSender*};
%typemap{Ref<GCodeSender>}{simple};
%typemap{Clone<GCodeSender>}{simple};
+%typemap{GCodePressureEqualizer*};
+%typemap{Ref<GCodePressureEqualizer>}{simple};
+%typemap{Clone<GCodePressureEqualizer>}{simple};
%typemap{BridgeDetector*};
%typemap{Ref<BridgeDetector>}{simple};
%typemap{Clone<BridgeDetector>}{simple};