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

ExtrusionMultiPath.xsp « xsp « xs - github.com/prusa3d/PrusaSlicer.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 5dd9382450ef9a2b5e1299af9ab2060efb986735 (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
%module{Slic3r::XS};

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

%name{Slic3r::ExtrusionMultiPath} class ExtrusionMultiPath {
    ExtrusionMultiPath();
    ~ExtrusionMultiPath();
    Clone<ExtrusionMultiPath> clone()
        %code{% RETVAL = THIS; %};
    void reverse();
    Clone<Point> first_point();
    Clone<Point> last_point();
    void append(ExtrusionPath* path)
        %code{% THIS->paths.push_back(*path); %};
    double length();
    Polygons polygons_covered_by_width();
    Polygons polygons_covered_by_spacing();
    Clone<Polyline> polyline()
        %code{% RETVAL = THIS->as_polyline(); %};
%{

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

%}
};