2015-07-01 18:14:05 +00:00
|
|
|
%module{Slic3r::XS};
|
|
|
|
|
|
|
|
%{
|
2015-12-07 23:39:54 +00:00
|
|
|
#include <xsinit.h>
|
2015-07-01 18:14:05 +00:00
|
|
|
#include "libslic3r/GCode.hpp"
|
2016-12-21 22:09:58 +00:00
|
|
|
#include "libslic3r/GCode/CoolingBuffer.hpp"
|
2015-07-01 18:14:05 +00:00
|
|
|
%}
|
|
|
|
|
|
|
|
%name{Slic3r::GCode::AvoidCrossingPerimeters} class AvoidCrossingPerimeters {
|
|
|
|
AvoidCrossingPerimeters();
|
|
|
|
~AvoidCrossingPerimeters();
|
|
|
|
|
|
|
|
void init_external_mp(ExPolygons islands);
|
|
|
|
void init_layer_mp(ExPolygons islands);
|
2015-07-01 21:00:52 +00:00
|
|
|
Clone<Polyline> travel_to(GCode* gcode, Point* point)
|
|
|
|
%code{% RETVAL = THIS->travel_to(*gcode, *point); %};
|
2015-07-01 18:14:05 +00:00
|
|
|
|
|
|
|
bool use_external_mp()
|
|
|
|
%code{% RETVAL = THIS->use_external_mp; %};
|
|
|
|
void set_use_external_mp(bool value)
|
|
|
|
%code{% THIS->use_external_mp = value; %};
|
|
|
|
|
|
|
|
bool use_external_mp_once()
|
|
|
|
%code{% RETVAL = THIS->use_external_mp_once; %};
|
|
|
|
void set_use_external_mp_once(bool value)
|
|
|
|
%code{% THIS->use_external_mp_once = value; %};
|
|
|
|
|
|
|
|
bool disable_once()
|
|
|
|
%code{% RETVAL = THIS->disable_once; %};
|
|
|
|
void set_disable_once(bool value)
|
|
|
|
%code{% THIS->disable_once = value; %};
|
|
|
|
};
|
2015-07-01 18:57:16 +00:00
|
|
|
|
2015-07-01 19:01:42 +00:00
|
|
|
%name{Slic3r::GCode::OozePrevention} class OozePrevention {
|
|
|
|
OozePrevention();
|
|
|
|
~OozePrevention();
|
|
|
|
|
|
|
|
bool enable()
|
|
|
|
%code{% RETVAL = THIS->enable; %};
|
|
|
|
void set_enable(bool value)
|
|
|
|
%code{% THIS->enable = value; %};
|
|
|
|
|
|
|
|
Points standby_points()
|
|
|
|
%code{% RETVAL = THIS->standby_points; %};
|
|
|
|
void set_standby_points(Points points)
|
|
|
|
%code{% THIS->standby_points = points; %};
|
2015-07-02 13:02:20 +00:00
|
|
|
|
|
|
|
std::string pre_toolchange(GCode* gcodegen)
|
|
|
|
%code{% RETVAL = THIS->pre_toolchange(*gcodegen); %};
|
|
|
|
std::string post_toolchange(GCode* gcodegen)
|
|
|
|
%code{% RETVAL = THIS->post_toolchange(*gcodegen); %};
|
2015-07-01 19:01:42 +00:00
|
|
|
};
|
|
|
|
|
2015-07-01 18:57:16 +00:00
|
|
|
%name{Slic3r::GCode::Wipe} class Wipe {
|
|
|
|
Wipe();
|
|
|
|
~Wipe();
|
|
|
|
|
|
|
|
bool has_path();
|
|
|
|
void reset_path();
|
2015-07-01 21:00:52 +00:00
|
|
|
std::string wipe(GCode* gcodegen, bool toolchange = false)
|
|
|
|
%code{% RETVAL = THIS->wipe(*gcodegen, toolchange); %};
|
2015-07-01 18:57:16 +00:00
|
|
|
|
|
|
|
bool enable()
|
|
|
|
%code{% RETVAL = THIS->enable; %};
|
|
|
|
void set_enable(bool value)
|
|
|
|
%code{% THIS->enable = value; %};
|
|
|
|
|
|
|
|
Ref<Polyline> path()
|
|
|
|
%code{% RETVAL = &(THIS->path); %};
|
|
|
|
void set_path(Polyline* value)
|
|
|
|
%code{% THIS->path = *value; %};
|
|
|
|
};
|
2015-07-01 19:47:17 +00:00
|
|
|
|
2016-12-21 22:09:58 +00:00
|
|
|
%name{Slic3r::GCode::CoolingBuffer} class CoolingBuffer {
|
|
|
|
CoolingBuffer(GCode* gcode)
|
|
|
|
%code{% RETVAL = new CoolingBuffer(*gcode); %};
|
|
|
|
~CoolingBuffer();
|
|
|
|
Ref<GCode> gcodegen();
|
|
|
|
|
|
|
|
std::string append(std::string gcode, std::string obj_id, size_t layer_id, float print_z);
|
|
|
|
std::string flush();
|
|
|
|
};
|
|
|
|
|
2015-07-01 19:47:17 +00:00
|
|
|
%name{Slic3r::GCode} class GCode {
|
|
|
|
GCode();
|
|
|
|
~GCode();
|
|
|
|
|
|
|
|
Ref<Pointf> origin()
|
|
|
|
%code{% RETVAL = &(THIS->origin); %};
|
|
|
|
|
2015-12-16 11:33:19 +00:00
|
|
|
Ref<StaticPrintConfig> config()
|
2015-07-01 19:47:17 +00:00
|
|
|
%code{% RETVAL = &(THIS->config); %};
|
|
|
|
|
|
|
|
Ref<GCodeWriter> writer()
|
|
|
|
%code{% RETVAL = &(THIS->writer); %};
|
|
|
|
|
|
|
|
Ref<PlaceholderParser> placeholder_parser()
|
|
|
|
%code{% RETVAL = THIS->placeholder_parser; %};
|
|
|
|
void set_placeholder_parser(PlaceholderParser* ptr)
|
|
|
|
%code{% THIS->placeholder_parser = ptr; %};
|
|
|
|
|
|
|
|
Ref<OozePrevention> ooze_prevention()
|
|
|
|
%code{% RETVAL = &(THIS->ooze_prevention); %};
|
|
|
|
|
|
|
|
Ref<Wipe> wipe()
|
|
|
|
%code{% RETVAL = &(THIS->wipe); %};
|
|
|
|
|
|
|
|
Ref<AvoidCrossingPerimeters> avoid_crossing_perimeters()
|
|
|
|
%code{% RETVAL = &(THIS->avoid_crossing_perimeters); %};
|
|
|
|
|
|
|
|
bool enable_loop_clipping()
|
|
|
|
%code{% RETVAL = THIS->enable_loop_clipping; %};
|
|
|
|
void set_enable_loop_clipping(bool value)
|
|
|
|
%code{% THIS->enable_loop_clipping = value; %};
|
|
|
|
|
|
|
|
bool enable_cooling_markers()
|
|
|
|
%code{% RETVAL = THIS->enable_cooling_markers; %};
|
|
|
|
void set_enable_cooling_markers(bool value)
|
|
|
|
%code{% THIS->enable_cooling_markers = value; %};
|
|
|
|
|
2016-09-12 14:25:15 +00:00
|
|
|
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; %};
|
|
|
|
|
2015-07-01 19:47:17 +00:00
|
|
|
int layer_count()
|
|
|
|
%code{% RETVAL = THIS->layer_count; %};
|
|
|
|
void set_layer_count(int value)
|
|
|
|
%code{% THIS->layer_count = value; %};
|
|
|
|
|
|
|
|
int layer_index()
|
|
|
|
%code{% RETVAL = THIS->layer_index; %};
|
|
|
|
void set_layer_index(int value)
|
|
|
|
%code{% THIS->layer_index = value; %};
|
|
|
|
|
|
|
|
bool has_layer()
|
|
|
|
%code{% RETVAL = THIS->layer != NULL; %};
|
|
|
|
Ref<Layer> layer()
|
|
|
|
%code{% RETVAL = THIS->layer; %};
|
|
|
|
void set_layer(Layer* ptr)
|
|
|
|
%code{% THIS->layer = ptr; %};
|
|
|
|
|
|
|
|
bool first_layer()
|
|
|
|
%code{% RETVAL = THIS->first_layer; %};
|
|
|
|
void set_first_layer(bool value)
|
|
|
|
%code{% THIS->first_layer = value; %};
|
|
|
|
|
2016-04-12 17:10:58 +00:00
|
|
|
float elapsed_time()
|
2015-07-01 19:47:17 +00:00
|
|
|
%code{% RETVAL = THIS->elapsed_time; %};
|
2016-04-12 17:10:58 +00:00
|
|
|
void set_elapsed_time(float value)
|
2015-07-01 19:47:17 +00:00
|
|
|
%code{% THIS->elapsed_time = value; %};
|
|
|
|
|
2015-07-01 21:00:52 +00:00
|
|
|
bool last_pos_defined();
|
2015-07-01 19:47:17 +00:00
|
|
|
Ref<Point> last_pos()
|
2015-07-01 21:00:52 +00:00
|
|
|
%code{% RETVAL = &(THIS->last_pos()); %};
|
|
|
|
void set_last_pos(Point* pos)
|
|
|
|
%code{% THIS->set_last_pos(*pos); %};
|
2015-07-01 19:47:17 +00:00
|
|
|
|
|
|
|
double volumetric_speed()
|
|
|
|
%code{% RETVAL = THIS->volumetric_speed; %};
|
|
|
|
void set_volumetric_speed(double value)
|
|
|
|
%code{% THIS->volumetric_speed = value; %};
|
2015-07-01 21:00:52 +00:00
|
|
|
|
2015-12-16 11:33:19 +00:00
|
|
|
void apply_print_config(StaticPrintConfig* print_config)
|
|
|
|
%code{%
|
|
|
|
if (const PrintConfig* config = dynamic_cast<PrintConfig*>(print_config)) {
|
|
|
|
THIS->apply_print_config(*config);
|
|
|
|
} else {
|
|
|
|
CONFESS("A PrintConfig object was not supplied to apply_print_config()");
|
|
|
|
}
|
|
|
|
%};
|
2015-07-02 17:33:08 +00:00
|
|
|
void set_extruders(std::vector<unsigned int> extruder_ids);
|
2015-07-01 21:00:52 +00:00
|
|
|
void set_origin(Pointf* pointf)
|
|
|
|
%code{% THIS->set_origin(*pointf); %};
|
|
|
|
std::string preamble();
|
2015-07-02 17:33:08 +00:00
|
|
|
std::string change_layer(Layer* layer)
|
|
|
|
%code{% RETVAL = THIS->change_layer(*layer); %};
|
2015-07-02 18:24:16 +00:00
|
|
|
%name{extrude_loop} std::string extrude(ExtrusionLoop* loop, std::string description = "", double speed = -1)
|
|
|
|
%code{% RETVAL = THIS->extrude(*loop, description, speed); %};
|
2017-01-19 12:35:55 +00:00
|
|
|
%name{extrude_multipath} std::string extrude(ExtrusionMultiPath* multipath, std::string description = "", double speed = -1)
|
|
|
|
%code{% RETVAL = THIS->extrude(*multipath, description, speed); %};
|
2015-07-02 18:24:16 +00:00
|
|
|
%name{extrude_path} std::string extrude(ExtrusionPath* path, std::string description = "", double speed = -1)
|
|
|
|
%code{% RETVAL = THIS->extrude(*path, description, speed); %};
|
2017-04-07 15:37:30 +00:00
|
|
|
std::string extrude_support(ExtrusionEntityCollection *support_fills, unsigned int extruder_id);
|
2015-07-02 13:12:04 +00:00
|
|
|
std::string travel_to(Point* point, ExtrusionRole role, std::string comment)
|
|
|
|
%code{% RETVAL = THIS->travel_to(*point, role, comment); %};
|
2015-07-02 12:29:20 +00:00
|
|
|
bool needs_retraction(Polyline* travel, ExtrusionRole role = erNone)
|
2015-07-01 21:14:40 +00:00
|
|
|
%code{% RETVAL = THIS->needs_retraction(*travel, role); %};
|
2015-07-01 21:00:52 +00:00
|
|
|
std::string retract(bool toolchange = false);
|
|
|
|
std::string unretract();
|
2015-07-02 13:02:20 +00:00
|
|
|
std::string set_extruder(unsigned int extruder_id);
|
2015-07-01 21:00:52 +00:00
|
|
|
Clone<Pointf> point_to_gcode(Point* point)
|
|
|
|
%code{% RETVAL = THIS->point_to_gcode(*point); %};
|
2015-07-02 18:24:16 +00:00
|
|
|
|
|
|
|
%{
|
|
|
|
std::string
|
|
|
|
GCode::extrude(entity, description, speed)
|
|
|
|
SV* entity
|
|
|
|
std::string description;
|
|
|
|
double speed;
|
|
|
|
CODE:
|
|
|
|
ExtrusionEntity* e = (ExtrusionEntity *)SvIV((SV*)SvRV( entity ));
|
|
|
|
RETVAL = THIS->extrude(*e, description, speed);
|
|
|
|
OUTPUT:
|
|
|
|
RETVAL
|
|
|
|
%}
|
|
|
|
|
2015-07-01 19:47:17 +00:00
|
|
|
};
|