mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-10-23 08:41:11 -06:00
New config field extruder_color for preview of extruder assignment.
This commit is contained in:
parent
2713aa1772
commit
7d64c465c0
13 changed files with 284 additions and 64 deletions
|
@ -293,6 +293,9 @@ std::vector<GCode::LayerToPrint> GCode::collect_layers_to_print(const PrintObjec
|
|||
return layers_to_print;
|
||||
}
|
||||
|
||||
// Prepare for non-sequential printing of multiple objects: Support resp. object layers with nearly identical print_z
|
||||
// will be printed for all objects at once.
|
||||
// Return a list of <print_z, per object LayerToPrint> items.
|
||||
std::vector<std::pair<coordf_t, std::vector<GCode::LayerToPrint>>> GCode::collect_layers_to_print(const Print &print)
|
||||
{
|
||||
struct OrderingItem {
|
||||
|
@ -304,11 +307,12 @@ std::vector<std::pair<coordf_t, std::vector<GCode::LayerToPrint>>> GCode::collec
|
|||
std::vector<OrderingItem> ordering;
|
||||
for (size_t i = 0; i < print.objects.size(); ++ i) {
|
||||
per_object[i] = collect_layers_to_print(*print.objects[i]);
|
||||
const LayerToPrint &front = per_object[i].front();
|
||||
OrderingItem ordering_item;
|
||||
ordering_item.object_idx = i;
|
||||
ordering.reserve(ordering.size() + per_object[i].size());
|
||||
const LayerToPrint &front = per_object[i].front();
|
||||
for (const LayerToPrint <p : per_object[i]) {
|
||||
ordering_item.print_z = ltp.print_z();
|
||||
ordering_item.print_z = ltp.print_z();
|
||||
ordering_item.layer_idx = <p - &front;
|
||||
ordering.emplace_back(ordering_item);
|
||||
}
|
||||
|
|
|
@ -142,6 +142,7 @@ Print::invalidate_state_by_config_options(const std::vector<t_config_option_key>
|
|||
|| *opt_key == "end_gcode"
|
||||
|| *opt_key == "extruder_clearance_height"
|
||||
|| *opt_key == "extruder_clearance_radius"
|
||||
|| *opt_key == "extruder_colour"
|
||||
|| *opt_key == "extruder_offset"
|
||||
|| *opt_key == "extrusion_axis"
|
||||
|| *opt_key == "extrusion_multiplier"
|
||||
|
|
|
@ -243,6 +243,19 @@ PrintConfigDef::PrintConfigDef()
|
|||
def->min = 0;
|
||||
def->default_value = new ConfigOptionFloat(20);
|
||||
|
||||
def = this->add("extruder_colour", coStrings);
|
||||
def->label = "Extruder Color";
|
||||
def->tooltip = "This is only used in the Slic3r interface as a visual help.";
|
||||
def->cli = "extruder-color=s@";
|
||||
def->gui_type = "color";
|
||||
{
|
||||
ConfigOptionStrings* opt = new ConfigOptionStrings();
|
||||
// Empty string means no color assigned yet.
|
||||
// opt->values.push_back("#FFFFFF");
|
||||
opt->values.push_back("");
|
||||
def->default_value = opt;
|
||||
}
|
||||
|
||||
def = this->add("extruder_offset", coPoints);
|
||||
def->label = "Extruder offset";
|
||||
def->tooltip = "If your firmware doesn't handle the extruder displacement you need the G-code to take it into account. This option lets you specify the displacement of each extruder with respect to the first one. It expects positive coordinates (they will be subtracted from the XY coordinate).";
|
||||
|
|
|
@ -413,7 +413,7 @@ public:
|
|||
// This object is mapped to Perl as Slic3r::Config::Print.
|
||||
class PrintConfig : public GCodeConfig
|
||||
{
|
||||
public:
|
||||
public:
|
||||
ConfigOptionBool avoid_crossing_perimeters;
|
||||
ConfigOptionPoints bed_shape;
|
||||
ConfigOptionInt bed_temperature;
|
||||
|
@ -427,6 +427,7 @@ class PrintConfig : public GCodeConfig
|
|||
ConfigOptionFloat duplicate_distance;
|
||||
ConfigOptionFloat extruder_clearance_height;
|
||||
ConfigOptionFloat extruder_clearance_radius;
|
||||
ConfigOptionStrings extruder_colour;
|
||||
ConfigOptionPoints extruder_offset;
|
||||
ConfigOptionBool fan_always_on;
|
||||
ConfigOptionInt fan_below_layer_time;
|
||||
|
@ -491,6 +492,7 @@ class PrintConfig : public GCodeConfig
|
|||
OPT_PTR(duplicate_distance);
|
||||
OPT_PTR(extruder_clearance_height);
|
||||
OPT_PTR(extruder_clearance_radius);
|
||||
OPT_PTR(extruder_colour);
|
||||
OPT_PTR(extruder_offset);
|
||||
OPT_PTR(fan_always_on);
|
||||
OPT_PTR(fan_below_layer_time);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue