2016-12-08 18:02:16 +00:00
|
|
|
// Based on implementation by @platsch
|
|
|
|
|
|
|
|
#ifndef slic3r_SlicingAdaptive_hpp_
|
|
|
|
#define slic3r_SlicingAdaptive_hpp_
|
|
|
|
|
|
|
|
#include "Slicing.hpp"
|
|
|
|
#include "admesh/stl.h"
|
|
|
|
|
|
|
|
namespace Slic3r
|
|
|
|
{
|
|
|
|
|
2019-11-13 12:53:02 +00:00
|
|
|
class ModelVolume;
|
2016-12-08 18:02:16 +00:00
|
|
|
|
|
|
|
class SlicingAdaptive
|
|
|
|
{
|
|
|
|
public:
|
2019-12-13 12:43:16 +00:00
|
|
|
void clear();
|
|
|
|
void set_slicing_parameters(SlicingParameters params) { m_slicing_params = params; }
|
|
|
|
void prepare(const ModelObject &object);
|
|
|
|
// Return next layer height starting from the last print_z, using a quality measure
|
|
|
|
// (quality in range from 0 to 1, 0 - highest quality at low layer heights, 1 - lowest print quality at high layer heights).
|
|
|
|
// The layer height curve shall be centered roughly around the default profile's layer height for quality 0.5.
|
|
|
|
float next_layer_height(const float print_z, float quality, size_t ¤t_facet);
|
2019-11-13 14:06:17 +00:00
|
|
|
float horizontal_facet_distance(float z);
|
2019-12-13 12:43:16 +00:00
|
|
|
|
|
|
|
struct FaceZ {
|
|
|
|
std::pair<float, float> z_span;
|
|
|
|
// Cosine of the normal vector towards the Z axis.
|
|
|
|
float n_cos;
|
|
|
|
// Sine of the normal vector towards the Z axis.
|
|
|
|
float n_sin;
|
|
|
|
};
|
2016-12-08 18:02:16 +00:00
|
|
|
|
|
|
|
protected:
|
2019-12-13 12:43:16 +00:00
|
|
|
SlicingParameters m_slicing_params;
|
|
|
|
|
|
|
|
std::vector<FaceZ> m_faces;
|
2016-12-08 18:02:16 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}; // namespace Slic3r
|
|
|
|
|
|
|
|
#endif /* slic3r_SlicingAdaptive_hpp_ */
|