PrusaSlicer-NonPlainar/xs/xsp/TriangleMesh.xsp

38 lines
954 B
Plaintext
Raw Normal View History

2013-06-23 13:33:07 +00:00
%module{Slic3r::XS};
2013-06-22 15:16:45 +00:00
%package{Slic3r::TriangleMesh::XS};
%{
PROTOTYPES: DISABLE
2013-06-23 16:18:38 +00:00
#include <myinit.h>
2013-06-22 15:16:45 +00:00
std::string
hello_world()
CODE:
RETVAL = "Hello world!";
OUTPUT:
RETVAL
2013-06-23 16:18:38 +00:00
float
stl_volume(filename)
char* filename;
CODE:
stl_file stl_in;
stl_open(&stl_in, filename);
stl_check_facets_exact(&stl_in);
stl_in.stats.facets_w_1_bad_edge = (stl_in.stats.connected_facets_2_edge - stl_in.stats.connected_facets_3_edge);
stl_in.stats.facets_w_2_bad_edge = (stl_in.stats.connected_facets_1_edge - stl_in.stats.connected_facets_2_edge);
stl_in.stats.facets_w_3_bad_edge = (stl_in.stats.number_of_facets - stl_in.stats.connected_facets_1_edge);
stl_fix_normal_directions(&stl_in);
stl_fix_normal_values(&stl_in);
stl_calculate_volume(&stl_in);
RETVAL = stl_in.stats.volume;
stl_close(&stl_in);
OUTPUT:
RETVAL
2013-06-22 15:16:45 +00:00
%}