-
-
Notifications
You must be signed in to change notification settings - Fork 919
Expand file tree
/
Copy pathGCodePathConfig.h
More file actions
81 lines (59 loc) · 2.8 KB
/
GCodePathConfig.h
File metadata and controls
81 lines (59 loc) · 2.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
// Copyright (c) 2023 UltiMaker
// CuraEngine is released under the terms of the AGPLv3 or higher
#ifndef G_CODE_PATH_CONFIG_H
#define G_CODE_PATH_CONFIG_H
#include "PrintFeature.h"
#include "pathPlanning/SpeedDerivatives.h"
#include "settings/types/Ratio.h"
#include "settings/types/Velocity.h"
#include "utils/Coord_t.h"
namespace cura
{
/*!
* The GCodePathConfig is the configuration for moves/extrusion actions. This defines at which width the line is printed and at which speed.
*/
struct GCodePathConfig
{
coord_t z_offset{}; //<! vertical offset from 'full' layer height
PrintFeatureType type_{}; //!< name of the feature type
coord_t line_width{}; //!< width of the line extruded
coord_t layer_thickness{}; //!< current layer height in micron
Ratio flow{}; //!< extrusion flow modifier.
SpeedDerivatives speed_derivatives{}; //!< The speed settings (and acceleration and jerk) of the extruded line. May be changed when smoothSpeed is called.
bool is_bridge_path{ false }; //!< whether current config is used when bridging
double fan_speed{ FAN_SPEED_DEFAULT }; //!< fan speed override for this path, value should be within range 0-100 (inclusive) and ignored otherwise
double extrusion_mm3_per_mm{ calculateExtrusion() }; //!< current mm^3 filament moved per mm line traversed
static constexpr double FAN_SPEED_DEFAULT = -1;
bool is_unretraction_path{ false }; // whether current config is used for unretraction path
[[nodiscard]] constexpr bool operator==(const GCodePathConfig& other) const noexcept = default;
[[nodiscard]] constexpr auto operator<=>(const GCodePathConfig& other) const = default;
/*!
* Can only be called after the layer height has been set (which is done while writing the gcode!)
*/
[[nodiscard]] double getExtrusionMM3perMM() const noexcept;
/*!
* Get the movement speed in mm/s
*/
[[nodiscard]] Velocity getSpeed() const noexcept;
/*!
* Get the current acceleration of this config
*/
[[nodiscard]] Acceleration getAcceleration() const noexcept;
/*!
* Get the current jerk of this config
*/
[[nodiscard]] Velocity getJerk() const noexcept;
[[nodiscard]] coord_t getLineWidth() const noexcept;
[[nodiscard]] bool isTravelPath() const noexcept;
[[nodiscard]] bool isUnretractionMove() const noexcept;
[[nodiscard]] bool isBridgePath() const noexcept;
[[nodiscard]] double getFanSpeed() const noexcept;
[[nodiscard]] Ratio getFlowRatio() const noexcept;
[[nodiscard]] coord_t getLayerThickness() const noexcept;
[[nodiscard]] PrintFeatureType getPrintFeatureType() const noexcept;
void setPrintFeatureType(PrintFeatureType type);
private:
[[nodiscard]] double calculateExtrusion() const noexcept;
};
} // namespace cura
#endif // G_CODE_PATH_CONFIG_H