~ubuntu-branches/ubuntu/utopic/slic3r/utopic

« back to all changes in this revision

Viewing changes to xs/src/Flow.hpp

  • Committer: Package Import Robot
  • Author(s): Chow Loong Jin
  • Date: 2014-06-17 01:27:26 UTC
  • Revision ID: package-import@ubuntu.com-20140617012726-2wrs4zdo251nr4vg
Tags: upstream-1.1.4+dfsg
ImportĀ upstreamĀ versionĀ 1.1.4+dfsg

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#ifndef slic3r_Flow_hpp_
 
2
#define slic3r_Flow_hpp_
 
3
 
 
4
#include <myinit.h>
 
5
#include "Config.hpp"
 
6
#include "ExtrusionEntity.hpp"
 
7
 
 
8
namespace Slic3r {
 
9
 
 
10
#define BRIDGE_EXTRA_SPACING 0.05
 
11
#define OVERLAP_FACTOR 1.0
 
12
 
 
13
enum FlowRole {
 
14
    frPerimeter,
 
15
    frInfill,
 
16
    frSolidInfill,
 
17
    frTopSolidInfill,
 
18
    frSupportMaterial,
 
19
    frSupportMaterialInterface,
 
20
};
 
21
 
 
22
class Flow
 
23
{
 
24
    public:
 
25
    float width;
 
26
    float spacing;
 
27
    float nozzle_diameter;
 
28
    bool bridge;
 
29
    coord_t scaled_width;
 
30
    coord_t scaled_spacing;
 
31
    
 
32
    Flow(float _w, float _s, float _nd): width(_w), spacing(_s), nozzle_diameter(_nd), bridge(false) {
 
33
        this->scaled_width   = scale_(this->width);
 
34
        this->scaled_spacing = scale_(this->spacing);
 
35
    };
 
36
    double mm3_per_mm(float h);
 
37
    static Flow new_from_config_width(FlowRole role, const ConfigOptionFloatOrPercent &width, float nozzle_diameter, float height, float bridge_flow_ratio);
 
38
    static Flow new_from_spacing(float spacing, float nozzle_diameter, float height, bool bridge);
 
39
    
 
40
    private:
 
41
    static float _width(FlowRole role, float nozzle_diameter, float height, float bridge_flow_ratio);
 
42
    static float _width_from_spacing(float spacing, float nozzle_diameter, float height, bool bridge);
 
43
    static float _spacing(float width, float nozzle_diameter, float height, float bridge_flow_ratio);
 
44
};
 
45
 
 
46
}
 
47
 
 
48
#endif