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

Filler.xsp « xsp « xs - github.com/prusa3d/PrusaSlicer.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 647d851eb1e4a677d4b988350b47158125a08dcc (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
66
67
68
69
%module{Slic3r::XS};

%{
#include <xsinit.h>
#include "libslic3r/Fill/Fill.hpp"
#include "libslic3r/ExtrusionEntity.hpp"
#include "libslic3r/ExtrusionEntityCollection.hpp"
%}

%name{Slic3r::Filler} class Filler {
    ~Filler();

    void set_bounding_box(BoundingBox *bbox)
        %code{% THIS->fill->set_bounding_box(*bbox); %};
    void set_spacing(coordf_t spacing)
        %code{% THIS->fill->spacing = spacing; %};
    coordf_t spacing()
        %code{% RETVAL = THIS->fill->spacing; %};
    void set_layer_id(size_t layer_id)
        %code{% THIS->fill->layer_id = layer_id; %};
    void set_z(coordf_t z)
        %code{% THIS->fill->z = z; %};
    void set_angle(float angle)
        %code{% THIS->fill->angle = angle; %};
    void set_link_max_length(coordf_t len)
        %code{% THIS->fill->link_max_length = len; %};
    void set_loop_clipping(coordf_t clipping)
        %code{% THIS->fill->loop_clipping = clipping; %};

    bool use_bridge_flow()
        %code{% RETVAL = THIS->fill->use_bridge_flow(); %};
    bool no_sort()
        %code{% RETVAL = THIS->fill->no_sort(); %};

    void set_density(float density)
        %code{% THIS->params.density = density; %};
    void set_dont_connect(bool dont_connect)
        %code{% THIS->params.dont_connect = dont_connect; %};
    void set_dont_adjust(bool dont_adjust)
        %code{% THIS->params.dont_adjust = dont_adjust; %};
    void set_complete(bool complete)
        %code{% THIS->params.complete = complete; %};

    PolylineCollection* _fill_surface(Surface *surface)
        %code{% 
            PolylineCollection *pc = NULL;
            if (THIS->fill != NULL) {
                pc = new PolylineCollection();
                pc->polylines = THIS->fill->fill_surface(surface, THIS->params);
            }
            RETVAL =  pc;
        %};

%{

Filler*
new_from_type(CLASS, type)
    char*               CLASS;
    std::string         type;
    CODE:
        Filler *filler = new Filler();
        filler->fill = Fill::new_from_type(type);
        RETVAL = filler;
    OUTPUT:
        RETVAL

%}

};