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

GCodeWriter.xsp « xsp « xs - github.com/supermerill/SuperSlicer.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 15a919da89cacd2c8ba60cf4e3b357d4104b68ca (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
%module{Slic3r::XS};

%{
#include <xsinit.h>
#include "libslic3r/GCodeWriter.hpp"
%}

%name{Slic3r::GCode::Writer} class GCodeWriter {
    GCodeWriter();
    ~GCodeWriter();
    
    Ref<GCodeConfig> config()
        %code%{ RETVAL = &THIS->config; %};
    bool multiple_extruders()
        %code{% RETVAL = THIS->multiple_extruders; %};
    Ref<Extruder> extruder();
    std::string extrusion_axis();
    void apply_print_config(PrintConfig* print_config)
        %code{% THIS->apply_print_config(*print_config); %};
    void set_extruders(std::vector<unsigned int> extruder_ids);
    std::string preamble();
    std::string postamble();
    std::string set_temperature(unsigned int temperature, bool wait = false, int tool = -1);
    std::string set_bed_temperature(unsigned int temperature, bool wait = false);
    std::string set_fan(unsigned int speed, bool dont_save = false);
    std::string set_acceleration(unsigned int acceleration);
    std::string reset_e(bool force = false);
    std::string update_progress(unsigned int num, unsigned int tot, bool allow_100 = false);
    bool need_toolchange(unsigned int extruder_id);
    std::string set_extruder(unsigned int extruder_id);
    std::string toolchange(unsigned int extruder_id);
    std::string set_speed(double F, std::string comment = std::string());
    std::string travel_to_xy(Pointf* point, std::string comment = std::string())
        %code{% RETVAL = THIS->travel_to_xy(*point, comment); %};
    std::string travel_to_xyz(Pointf3* point, std::string comment = std::string())
        %code{% RETVAL = THIS->travel_to_xyz(*point, comment); %};
    std::string travel_to_z(double z, std::string comment = std::string());
    bool will_move_z(double z);
    std::string extrude_to_xy(Pointf* point, double dE, std::string comment = std::string())
        %code{% RETVAL = THIS->extrude_to_xy(*point, dE, comment); %};
    std::string extrude_to_xyz(Pointf3* point, double dE, std::string comment = std::string())
        %code{% RETVAL = THIS->extrude_to_xyz(*point, dE, comment); %};
    std::string retract();
    std::string retract_for_toolchange();
    std::string unretract();
    std::string lift();
    std::string unlift();
    Clone<Pointf3> get_position() const;
%{

SV*
GCodeWriter::extruders()
    CODE:
        AV* av = newAV();
        av_fill(av, THIS->extruders.size()-1);
        int i = 0;
        for (std::map<unsigned int,Extruder>::iterator it = THIS->extruders.begin(); it != THIS->extruders.end(); ++it) {
            av_store(av, i++, perl_to_SV_ref(it->second));
        }
        RETVAL = newRV_noinc((SV*)av);
    OUTPUT:
        RETVAL

%}
};