mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-10-23 08:41:11 -06:00
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.
This commit is contained in:
parent
8f04f5d5f6
commit
e0d1aa8a1a
7 changed files with 226 additions and 22 deletions
|
@ -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;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue