mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-11 16:57:53 -06:00
Set custom color for color change
This commit is contained in:
parent
c564f693e9
commit
d5f7956a55
5 changed files with 150 additions and 142 deletions
|
@ -749,27 +749,30 @@ public:
|
|||
// Extensions for color print
|
||||
struct CustomGCode
|
||||
{
|
||||
CustomGCode(double height, const std::string& code, int extruder) :
|
||||
height(height), gcode(code), extruder(extruder) {}
|
||||
CustomGCode(double height, const std::string& code, int extruder, const std::string& color) :
|
||||
height(height), gcode(code), extruder(extruder), color(color) {}
|
||||
|
||||
bool operator<(const CustomGCode& other) const { return other.height > this->height; }
|
||||
bool operator==(const CustomGCode& other) const
|
||||
{
|
||||
return (other.height == this->height) &&
|
||||
(other.gcode == this->gcode) &&
|
||||
(other.extruder == this->extruder );
|
||||
(other.extruder == this->extruder )&&
|
||||
(other.color == this->color );
|
||||
}
|
||||
bool operator!=(const CustomGCode& other) const
|
||||
{
|
||||
return (other.height != this->height) ||
|
||||
(other.gcode != this->gcode) ||
|
||||
(other.extruder != this->extruder );
|
||||
(other.extruder != this->extruder )||
|
||||
(other.color != this->color );
|
||||
}
|
||||
|
||||
double height;
|
||||
std::string gcode;
|
||||
int extruder; // 0 - "gcode" will be applied for whole print
|
||||
// else - "gcode" will be applied only for "extruder" print
|
||||
std::string color;
|
||||
};
|
||||
std::vector<CustomGCode> custom_gcode_per_height;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue