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

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

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

%name{Slic3r::TriangleMesh::XS} class TriangleMesh {
    TriangleMesh();
    ~TriangleMesh();
    void ReadSTLFile(char* input_file);
    void ReadFromPerl(SV* vertices, SV* facets);
    void Repair();
    void WriteOBJFile(char* output_file);
    AV* ToPerl();
%{

SV*
TriangleMesh::stats()
    CODE:
        HV* hv = newHV();
        (void)hv_stores( hv, "number_of_facets",    newSViv(THIS->stl.stats.number_of_facets) );
        (void)hv_stores( hv, "number_of_parts",     newSViv(THIS->stl.stats.number_of_parts) );
        (void)hv_stores( hv, "volume",              newSVnv(THIS->stl.stats.volume) );
        (void)hv_stores( hv, "degenerate_facets",   newSViv(THIS->stl.stats.degenerate_facets) );
        (void)hv_stores( hv, "edges_fixed",         newSViv(THIS->stl.stats.edges_fixed) );
        (void)hv_stores( hv, "facets_removed",      newSViv(THIS->stl.stats.facets_removed) );
        (void)hv_stores( hv, "facets_added",        newSViv(THIS->stl.stats.facets_added) );
        (void)hv_stores( hv, "facets_reversed",     newSViv(THIS->stl.stats.facets_reversed) );
        (void)hv_stores( hv, "backwards_edges",     newSViv(THIS->stl.stats.backwards_edges) );
        (void)hv_stores( hv, "normals_fixed",       newSViv(THIS->stl.stats.normals_fixed) );
        (void)hv_stores( hv, "facets_reversed",     newSViv(THIS->stl.stats.facets_reversed) );
        RETVAL = (SV*)newRV_noinc((SV*)hv);
    OUTPUT:
        RETVAL

%}
};

%package{Slic3r::TriangleMesh::XS};

%{
PROTOTYPES: DISABLE

std::string
hello_world()
  CODE:
    RETVAL = "Hello world!";
  OUTPUT:
    RETVAL
%}