2015-07-03 20:58:29 +00:00
|
|
|
#ifndef slic3r_PerimeterGenerator_hpp_
|
|
|
|
#define slic3r_PerimeterGenerator_hpp_
|
|
|
|
|
2015-12-07 23:39:54 +00:00
|
|
|
#include "libslic3r.h"
|
2015-07-23 13:53:02 +00:00
|
|
|
#include <vector>
|
|
|
|
#include "Flow.hpp"
|
|
|
|
#include "Polygon.hpp"
|
|
|
|
#include "PrintConfig.hpp"
|
|
|
|
#include "SurfaceCollection.hpp"
|
2015-07-03 20:58:29 +00:00
|
|
|
|
|
|
|
namespace Slic3r {
|
|
|
|
|
|
|
|
class PerimeterGenerator {
|
2016-09-13 11:30:00 +00:00
|
|
|
public:
|
|
|
|
// Inputs:
|
2018-09-11 12:04:47 +00:00
|
|
|
const SurfaceCollection *slices;
|
2019-10-01 15:17:08 +00:00
|
|
|
const ExPolygons *lower_slices;
|
2018-09-11 12:04:47 +00:00
|
|
|
double layer_height;
|
|
|
|
int layer_id;
|
|
|
|
Flow perimeter_flow;
|
|
|
|
Flow ext_perimeter_flow;
|
|
|
|
Flow overhang_flow;
|
|
|
|
Flow solid_infill_flow;
|
|
|
|
const PrintRegionConfig *config;
|
|
|
|
const PrintObjectConfig *object_config;
|
|
|
|
const PrintConfig *print_config;
|
2016-09-13 11:30:00 +00:00
|
|
|
// Outputs:
|
2018-09-11 12:04:47 +00:00
|
|
|
ExtrusionEntityCollection *loops;
|
|
|
|
ExtrusionEntityCollection *gap_fill;
|
|
|
|
SurfaceCollection *fill_surfaces;
|
2015-07-03 20:58:29 +00:00
|
|
|
|
2016-09-13 11:30:00 +00:00
|
|
|
PerimeterGenerator(
|
|
|
|
// Input:
|
|
|
|
const SurfaceCollection* slices,
|
|
|
|
double layer_height,
|
|
|
|
Flow flow,
|
2018-09-11 12:04:47 +00:00
|
|
|
const PrintRegionConfig* config,
|
|
|
|
const PrintObjectConfig* object_config,
|
|
|
|
const PrintConfig* print_config,
|
2020-12-09 13:07:22 +00:00
|
|
|
const bool spiral_vase,
|
2016-09-13 11:30:00 +00:00
|
|
|
// Output:
|
|
|
|
// Loops with the external thin walls
|
|
|
|
ExtrusionEntityCollection* loops,
|
|
|
|
// Gaps without the thin walls
|
|
|
|
ExtrusionEntityCollection* gap_fill,
|
|
|
|
// Infills without the gap fills
|
|
|
|
SurfaceCollection* fill_surfaces)
|
2019-10-01 15:17:08 +00:00
|
|
|
: slices(slices), lower_slices(nullptr), layer_height(layer_height),
|
2015-07-28 21:29:25 +00:00
|
|
|
layer_id(-1), perimeter_flow(flow), ext_perimeter_flow(flow),
|
|
|
|
overhang_flow(flow), solid_infill_flow(flow),
|
2015-07-06 23:17:31 +00:00
|
|
|
config(config), object_config(object_config), print_config(print_config),
|
2020-12-09 13:07:22 +00:00
|
|
|
m_spiral_vase(spiral_vase),
|
2021-11-30 16:51:53 +00:00
|
|
|
m_scaled_resolution(scaled<double>(print_config->gcode_resolution.value)),
|
2016-11-17 22:22:59 +00:00
|
|
|
loops(loops), gap_fill(gap_fill), fill_surfaces(fill_surfaces),
|
2019-09-11 09:37:48 +00:00
|
|
|
m_ext_mm3_per_mm(-1), m_mm3_per_mm(-1), m_mm3_per_mm_overhang(-1)
|
2019-09-04 14:11:16 +00:00
|
|
|
{}
|
2019-09-11 09:37:48 +00:00
|
|
|
|
|
|
|
void process();
|
|
|
|
|
|
|
|
double ext_mm3_per_mm() const { return m_ext_mm3_per_mm; }
|
|
|
|
double mm3_per_mm() const { return m_mm3_per_mm; }
|
|
|
|
double mm3_per_mm_overhang() const { return m_mm3_per_mm_overhang; }
|
|
|
|
Polygons lower_slices_polygons() const { return m_lower_slices_polygons; }
|
2017-07-19 13:42:49 +00:00
|
|
|
|
|
|
|
private:
|
2020-12-09 13:07:22 +00:00
|
|
|
bool m_spiral_vase;
|
2021-11-30 16:51:53 +00:00
|
|
|
double m_scaled_resolution;
|
2019-09-11 09:37:48 +00:00
|
|
|
double m_ext_mm3_per_mm;
|
|
|
|
double m_mm3_per_mm;
|
|
|
|
double m_mm3_per_mm_overhang;
|
|
|
|
Polygons m_lower_slices_polygons;
|
2015-07-06 23:17:31 +00:00
|
|
|
};
|
|
|
|
|
2015-07-03 20:58:29 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|