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

github.com/prusa3d/PrusaSlicer.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbubnikv <bubnikv@gmail.com>2016-09-26 14:44:23 +0300
committerbubnikv <bubnikv@gmail.com>2016-09-26 14:44:23 +0300
commite0d1aa8a1a6abb4bea8526636b6de79b515c51db (patch)
tree42ae539dbc2998b225d952ac209b7dde2c7cbcd6 /xs/src/libslic3r/Layer.hpp
parent8f04f5d5f61f4e6a5d4cb1a869ba771c6b9bc079 (diff)
Collect the perimeter surfaces when generating perimeters.
The perimeter surfaces are later used for performing infill below overhangs and to maintan configured vertical wall thickness at sloping surfaces.
Diffstat (limited to 'xs/src/libslic3r/Layer.hpp')
-rw-r--r--xs/src/libslic3r/Layer.hpp27
1 files changed, 23 insertions, 4 deletions
diff --git a/xs/src/libslic3r/Layer.hpp b/xs/src/libslic3r/Layer.hpp
index 4badb8374..23bc84e90 100644
--- a/xs/src/libslic3r/Layer.hpp
+++ b/xs/src/libslic3r/Layer.hpp
@@ -38,6 +38,11 @@ class LayerRegion
// collection of surfaces for infill generation
SurfaceCollection fill_surfaces;
+ // Collection of perimeter surfaces. This is a cached result of diff(slices, fill_surfaces).
+ // While not necessary, the memory consumption is meager and it speeds up calculation.
+ // The perimeter_surfaces keep the IDs of the slices (top/bottom/)
+ SurfaceCollection perimeter_surfaces;
+
// collection of expolygons representing the bridged areas (thus not
// needing support material)
Polygons bridged;
@@ -56,10 +61,16 @@ class LayerRegion
Flow flow(FlowRole role, bool bridge = false, double width = -1) const;
void merge_slices();
void prepare_fill_surfaces();
- void make_perimeters(const SurfaceCollection &slices, SurfaceCollection* fill_surfaces);
+ void make_perimeters(const SurfaceCollection &slices, SurfaceCollection* perimeter_surfaces, SurfaceCollection* fill_surfaces);
void process_external_surfaces(const Layer* lower_layer);
double infill_area_threshold() const;
-
+
+ void export_region_slices_to_svg(const char *path);
+ void export_region_fill_surfaces_to_svg(const char *path);
+ // Export to "out/LayerRegion-name-%d.svg" with an increasing index with every export.
+ void export_region_slices_to_svg_debug(const char *name);
+ void export_region_fill_surfaces_to_svg_debug(const char *name);
+
private:
Layer *_layer;
PrintRegion *_region;
@@ -74,7 +85,7 @@ typedef std::vector<LayerRegion*> LayerRegionPtrs;
class Layer {
friend class PrintObject;
- public:
+public:
size_t id() const;
void set_id(size_t id);
PrintObject* object();
@@ -91,6 +102,8 @@ class Layer {
// collection of expolygons generated by slicing the original geometry;
// also known as 'islands' (all regions and surface types are merged here)
ExPolygonCollection slices;
+ // Surfaces of the perimeters including their gap fill.
+ ExPolygonCollection perimeter_expolygons;
size_t region_count() const;
@@ -102,8 +115,14 @@ class Layer {
template <class T> bool any_internal_region_slice_contains(const T &item) const;
template <class T> bool any_bottom_region_slice_contains(const T &item) const;
void make_perimeters();
+
+ void export_region_slices_to_svg(const char *path);
+ void export_region_fill_surfaces_to_svg(const char *path);
+ // Export to "out/LayerRegion-name-%d.svg" with an increasing index with every export.
+ void export_region_slices_to_svg_debug(const char *name);
+ void export_region_fill_surfaces_to_svg_debug(const char *name);
- protected:
+protected:
size_t _id; // sequential number of layer, 0-based
PrintObject *_object;