2014-01-05 12:16:13 +00:00
|
|
|
#ifndef slic3r_Flow_hpp_
|
|
|
|
#define slic3r_Flow_hpp_
|
|
|
|
|
2015-12-07 23:39:54 +00:00
|
|
|
#include "libslic3r.h"
|
2014-01-05 12:16:13 +00:00
|
|
|
#include "Config.hpp"
|
|
|
|
#include "ExtrusionEntity.hpp"
|
|
|
|
|
|
|
|
namespace Slic3r {
|
|
|
|
|
|
|
|
#define BRIDGE_EXTRA_SPACING 0.05
|
|
|
|
#define OVERLAP_FACTOR 1.0
|
|
|
|
|
|
|
|
enum FlowRole {
|
2014-06-09 19:14:48 +00:00
|
|
|
frExternalPerimeter,
|
2014-01-05 12:16:13 +00:00
|
|
|
frPerimeter,
|
|
|
|
frInfill,
|
|
|
|
frSolidInfill,
|
|
|
|
frTopSolidInfill,
|
|
|
|
frSupportMaterial,
|
|
|
|
frSupportMaterialInterface,
|
|
|
|
};
|
|
|
|
|
|
|
|
class Flow
|
|
|
|
{
|
|
|
|
public:
|
2014-06-11 23:00:13 +00:00
|
|
|
float width, height, nozzle_diameter;
|
2014-01-05 12:16:13 +00:00
|
|
|
bool bridge;
|
|
|
|
|
2014-06-11 23:00:13 +00:00
|
|
|
Flow(float _w, float _h, float _nd, bool _bridge = false)
|
|
|
|
: width(_w), height(_h), nozzle_diameter(_nd), bridge(_bridge) {};
|
|
|
|
float spacing() const;
|
2014-06-12 07:15:40 +00:00
|
|
|
float spacing(const Flow &other) const;
|
2014-06-11 23:00:13 +00:00
|
|
|
double mm3_per_mm() const;
|
|
|
|
coord_t scaled_width() const {
|
|
|
|
return scale_(this->width);
|
2014-01-05 12:16:13 +00:00
|
|
|
};
|
2014-06-11 23:00:13 +00:00
|
|
|
coord_t scaled_spacing() const {
|
|
|
|
return scale_(this->spacing());
|
|
|
|
};
|
2015-12-19 15:46:56 +00:00
|
|
|
coord_t scaled_spacing(const Flow &other) const {
|
|
|
|
return scale_(this->spacing(other));
|
|
|
|
};
|
2014-06-11 23:00:13 +00:00
|
|
|
|
2014-01-05 12:16:13 +00:00
|
|
|
static Flow new_from_config_width(FlowRole role, const ConfigOptionFloatOrPercent &width, float nozzle_diameter, float height, float bridge_flow_ratio);
|
|
|
|
static Flow new_from_spacing(float spacing, float nozzle_diameter, float height, bool bridge);
|
|
|
|
|
|
|
|
private:
|
2014-06-11 23:00:13 +00:00
|
|
|
static float _bridge_width(float nozzle_diameter, float bridge_flow_ratio);
|
|
|
|
static float _auto_width(FlowRole role, float nozzle_diameter, float height);
|
2014-01-05 12:16:13 +00:00
|
|
|
static float _width_from_spacing(float spacing, float nozzle_diameter, float height, bool bridge);
|
|
|
|
static float _spacing(float width, float nozzle_diameter, float height, float bridge_flow_ratio);
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|