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

ExtrusionLoop.xsp « xsp « xs - github.com/supermerill/SuperSlicer.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 489bca03a9576bb72867db76fbfb7e77b8188fcb (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
70
71
72
73
%module{Slic3r::XS};

%{
#include <myinit.h>
#include "ExtrusionEntity.hpp"
%}

%name{Slic3r::ExtrusionLoop} class ExtrusionLoop {
    ExtrusionLoop();
    ~ExtrusionLoop();
    Clone<ExtrusionLoop> clone()
        %code{% RETVAL = THIS; %};
    void reverse();
    bool make_clockwise();
    bool make_counter_clockwise();
    Clone<Point> first_point();
    Clone<Point> last_point();
    Polygon* polygon()
        %code{% RETVAL = new Polygon (*THIS); %};
    void append(ExtrusionPath* path)
        %code{% THIS->paths.push_back(*path); %};
    double length();
    void split_at_vertex(Point* point)
        %code{% THIS->split_at_vertex(*point); %};
    void split_at(Point* point)
        %code{% THIS->split_at(*point); %};
    ExtrusionPaths clip_end(double distance)
        %code{% THIS->clip_end(distance, &RETVAL); %};
    bool has_overhang_point(Point* point)
        %code{% RETVAL = THIS->has_overhang_point(*point); %};
%{

SV*
ExtrusionLoop::arrayref()
    CODE:
        AV* av = newAV();
        av_fill(av, THIS->paths.size()-1);
        int i = 0;
        for (ExtrusionPaths::iterator it = THIS->paths.begin(); it != THIS->paths.end(); ++it) {
            av_store(av, i++, perl_to_SV_ref(*it));
        }
        RETVAL = newRV_noinc((SV*)av);
    OUTPUT:
        RETVAL

ExtrusionLoopRole
ExtrusionLoop::role(...)
    CODE:
        if (items > 1) {
            THIS->role = (ExtrusionLoopRole)SvUV(ST(1));
        }
        RETVAL = THIS->role;
    OUTPUT:
        RETVAL

%}
};

%package{Slic3r::ExtrusionLoop};
%{

IV
_constant()
  ALIAS:
    EXTRL_ROLE_DEFAULT                      = elrDefault
    EXTRL_ROLE_EXTERNAL_PERIMETER           = elrExternalPerimeter
    EXTRL_ROLE_CONTOUR_INTERNAL_PERIMETER   = elrContourInternalPerimeter
  PROTOTYPE:
  CODE:
    RETVAL = ix;
  OUTPUT: RETVAL

%}