2014-05-06 08:07:18 +00:00
|
|
|
%module{Slic3r::XS};
|
|
|
|
|
|
|
|
%{
|
2015-12-07 23:39:54 +00:00
|
|
|
#include <xsinit.h>
|
2014-08-03 17:42:29 +00:00
|
|
|
#include "libslic3r/Layer.hpp"
|
2019-10-01 15:17:08 +00:00
|
|
|
#include "libslic3r/ExPolygonCollection.hpp"
|
2014-05-06 08:07:18 +00:00
|
|
|
%}
|
|
|
|
|
|
|
|
%name{Slic3r::Layer::Region} class LayerRegion {
|
|
|
|
// owned by Layer, no constructor/destructor
|
|
|
|
|
2014-05-19 20:38:10 +00:00
|
|
|
Ref<Layer> layer();
|
2021-05-06 11:58:37 +00:00
|
|
|
Ref<PrintRegion> region()
|
|
|
|
%code%{ RETVAL = &THIS->region(); %};
|
2014-05-06 08:07:18 +00:00
|
|
|
|
|
|
|
Ref<SurfaceCollection> slices()
|
|
|
|
%code%{ RETVAL = &THIS->slices; %};
|
|
|
|
Ref<ExtrusionEntityCollection> thin_fills()
|
|
|
|
%code%{ RETVAL = &THIS->thin_fills; %};
|
|
|
|
Ref<SurfaceCollection> fill_surfaces()
|
|
|
|
%code%{ RETVAL = &THIS->fill_surfaces; %};
|
|
|
|
Ref<ExtrusionEntityCollection> perimeters()
|
|
|
|
%code%{ RETVAL = &THIS->perimeters; %};
|
|
|
|
Ref<ExtrusionEntityCollection> fills()
|
|
|
|
%code%{ RETVAL = &THIS->fills; %};
|
2014-08-03 17:17:23 +00:00
|
|
|
|
2021-03-08 13:29:23 +00:00
|
|
|
Clone<Flow> flow(FlowRole role)
|
|
|
|
%code%{ RETVAL = THIS->flow(role); %};
|
2015-02-01 11:43:58 +00:00
|
|
|
void prepare_fill_surfaces();
|
2016-11-17 22:22:59 +00:00
|
|
|
void make_perimeters(SurfaceCollection* slices, SurfaceCollection* fill_surfaces)
|
|
|
|
%code%{ THIS->make_perimeters(*slices, fill_surfaces); %};
|
2015-10-26 22:23:03 +00:00
|
|
|
double infill_area_threshold();
|
2016-09-26 11:44:23 +00:00
|
|
|
|
2017-09-14 11:15:32 +00:00
|
|
|
void export_region_slices_to_svg(const char *path) const;
|
|
|
|
void export_region_fill_surfaces_to_svg(const char *path) const;
|
|
|
|
void export_region_slices_to_svg_debug(const char *name) const;
|
|
|
|
void export_region_fill_surfaces_to_svg_debug(const char *name) const;
|
2014-05-06 08:07:18 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
%name{Slic3r::Layer} class Layer {
|
|
|
|
// owned by PrintObject, no constructor/destructor
|
2015-07-02 18:24:16 +00:00
|
|
|
|
|
|
|
Ref<Layer> as_layer()
|
|
|
|
%code%{ RETVAL = THIS; %};
|
2014-05-06 08:07:18 +00:00
|
|
|
|
2014-05-19 20:38:10 +00:00
|
|
|
int id();
|
2015-01-18 11:35:05 +00:00
|
|
|
void set_id(int id);
|
2014-05-19 20:38:10 +00:00
|
|
|
Ref<PrintObject> object();
|
2014-05-06 08:07:18 +00:00
|
|
|
bool slicing_errors()
|
|
|
|
%code%{ RETVAL = THIS->slicing_errors; %};
|
|
|
|
coordf_t slice_z()
|
|
|
|
%code%{ RETVAL = THIS->slice_z; %};
|
|
|
|
coordf_t print_z()
|
|
|
|
%code%{ RETVAL = THIS->print_z; %};
|
|
|
|
coordf_t height()
|
|
|
|
%code%{ RETVAL = THIS->height; %};
|
|
|
|
|
|
|
|
size_t region_count();
|
|
|
|
Ref<LayerRegion> get_region(int idx);
|
|
|
|
Ref<LayerRegion> add_region(PrintRegion* print_region);
|
|
|
|
|
2019-10-01 15:17:08 +00:00
|
|
|
ExPolygonCollection* slices()
|
2020-01-06 08:36:03 +00:00
|
|
|
%code%{ RETVAL = new ExPolygonCollection(THIS->lslices); %};
|
2016-09-26 11:44:23 +00:00
|
|
|
|
2014-06-10 14:17:34 +00:00
|
|
|
int ptr()
|
|
|
|
%code%{ RETVAL = (int)(intptr_t)THIS; %};
|
2014-08-03 16:41:09 +00:00
|
|
|
|
2015-07-01 19:47:17 +00:00
|
|
|
Ref<SupportLayer> as_support_layer()
|
|
|
|
%code%{ RETVAL = dynamic_cast<SupportLayer*>(THIS); %};
|
|
|
|
|
2014-08-03 16:41:09 +00:00
|
|
|
void make_slices();
|
2020-12-11 11:21:07 +00:00
|
|
|
void backup_untyped_slices();
|
|
|
|
void restore_untyped_slices();
|
2015-12-02 18:32:57 +00:00
|
|
|
void make_perimeters();
|
2016-11-02 09:47:00 +00:00
|
|
|
void make_fills();
|
2016-09-26 11:44:23 +00:00
|
|
|
|
|
|
|
void export_region_slices_to_svg(const char *path);
|
|
|
|
void export_region_fill_surfaces_to_svg(const char *path);
|
|
|
|
void export_region_slices_to_svg_debug(const char *name);
|
|
|
|
void export_region_fill_surfaces_to_svg_debug(const char *name);
|
2014-05-06 08:07:18 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
%name{Slic3r::Layer::Support} class SupportLayer {
|
|
|
|
// owned by PrintObject, no constructor/destructor
|
2015-07-01 19:47:17 +00:00
|
|
|
|
|
|
|
Ref<Layer> as_layer()
|
|
|
|
%code%{ RETVAL = THIS; %};
|
|
|
|
|
2014-05-06 08:07:18 +00:00
|
|
|
Ref<ExPolygonCollection> support_islands()
|
|
|
|
%code%{ RETVAL = &THIS->support_islands; %};
|
|
|
|
Ref<ExtrusionEntityCollection> support_fills()
|
|
|
|
%code%{ RETVAL = &THIS->support_fills; %};
|
|
|
|
|
|
|
|
// copies of some Layer methods, because the parameter wrapper code
|
|
|
|
// gets confused about getting a Layer::Support instead of a Layer
|
2014-05-24 21:50:49 +00:00
|
|
|
int id();
|
2015-01-18 11:35:05 +00:00
|
|
|
void set_id(int id);
|
2014-05-24 21:50:49 +00:00
|
|
|
Ref<PrintObject> object();
|
2014-05-06 08:07:18 +00:00
|
|
|
bool slicing_errors()
|
|
|
|
%code%{ RETVAL = THIS->slicing_errors; %};
|
|
|
|
coordf_t slice_z()
|
|
|
|
%code%{ RETVAL = THIS->slice_z; %};
|
|
|
|
coordf_t print_z()
|
|
|
|
%code%{ RETVAL = THIS->print_z; %};
|
|
|
|
coordf_t height()
|
|
|
|
%code%{ RETVAL = THIS->height; %};
|
|
|
|
|
|
|
|
size_t region_count();
|
|
|
|
Ref<LayerRegion> get_region(int idx);
|
|
|
|
Ref<LayerRegion> add_region(PrintRegion* print_region);
|
|
|
|
|
2019-10-01 15:17:08 +00:00
|
|
|
ExPolygonCollection* slices()
|
2020-01-06 08:36:03 +00:00
|
|
|
%code%{ RETVAL = new ExPolygonCollection(THIS->lslices); %};
|
2014-12-09 00:08:58 +00:00
|
|
|
|
2016-09-26 11:44:23 +00:00
|
|
|
void export_region_slices_to_svg(const char *path);
|
|
|
|
void export_region_fill_surfaces_to_svg(const char *path);
|
|
|
|
void export_region_slices_to_svg_debug(const char *name);
|
|
|
|
void export_region_fill_surfaces_to_svg_debug(const char *name);
|
2014-05-06 08:07:18 +00:00
|
|
|
};
|