mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2026-01-29 04:10:47 -07:00
ENH: wipe tower support filaments that do not adhere to each other
jira:none Change-Id: Ia52340f4e8bdb34791cb2019e9763bddfbc8dc5f (cherry picked from commit e1e0de6efb667a2a198be47d75c90b0f2f0a4324)
This commit is contained in:
parent
c1c862d2c3
commit
257fc86ca9
7 changed files with 1099 additions and 6 deletions
File diff suppressed because it is too large
Load diff
|
|
@ -8,6 +8,7 @@
|
|||
#include <algorithm>
|
||||
|
||||
#include "libslic3r/Point.hpp"
|
||||
#include <unordered_set>
|
||||
|
||||
namespace Slic3r
|
||||
{
|
||||
|
|
@ -146,6 +147,13 @@ public:
|
|||
bool is_finish,
|
||||
float purge_volume) const;
|
||||
|
||||
ToolChangeResult construct_block_tcr(WipeTowerWriter& writer,
|
||||
bool priming,
|
||||
size_t filament_id,
|
||||
bool is_finish,
|
||||
float purge_volume) const;
|
||||
|
||||
|
||||
// x -- x coordinates of wipe tower in mm ( left bottom corner )
|
||||
// y -- y coordinates of wipe tower in mm ( left bottom corner )
|
||||
// width -- width of wipe tower in mm ( default 60 mm - leave as it is )
|
||||
|
|
@ -164,7 +172,7 @@ public:
|
|||
// Iterates through prepared m_plan, generates ToolChangeResults and appends them to "result"
|
||||
void generate(std::vector<std::vector<ToolChangeResult>> &result);
|
||||
|
||||
WipeTower::ToolChangeResult only_generate_out_wall();
|
||||
WipeTower::ToolChangeResult only_generate_out_wall(bool is_new_mode = false);
|
||||
|
||||
float get_depth() const { return m_wipe_tower_depth; }
|
||||
float get_brim_width() const { return m_wipe_tower_brim_width_real; }
|
||||
|
|
@ -268,6 +276,7 @@ public:
|
|||
|
||||
struct FilamentParameters {
|
||||
std::string material = "PLA";
|
||||
int category;
|
||||
bool is_soluble = false;
|
||||
// BBS
|
||||
bool is_support = false;
|
||||
|
|
@ -289,6 +298,55 @@ public:
|
|||
float filament_area;
|
||||
};
|
||||
|
||||
|
||||
void set_used_filament_ids(const std::vector<int> &used_filament_ids) { m_used_filament_ids = used_filament_ids; };
|
||||
void set_filament_categories(const std::vector<int> & filament_categories) { m_filament_categories = filament_categories;};
|
||||
std::vector<int> m_used_filament_ids;
|
||||
std::vector<int> m_filament_categories;
|
||||
|
||||
struct WipeTowerBlock
|
||||
{
|
||||
int block_id{0};
|
||||
int filament_category{0};
|
||||
std::vector<float> layer_depths;
|
||||
float depth{0};
|
||||
float start_depth{0};
|
||||
float cur_depth{0};
|
||||
int last_filament_change_id{-1};
|
||||
int last_nozzle_change_id{-1};
|
||||
};
|
||||
|
||||
struct BlockDepthInfo
|
||||
{
|
||||
int category{-1};
|
||||
float depth{0};
|
||||
float nozzle_change_depth{0};
|
||||
};
|
||||
|
||||
std::vector<std::vector<BlockDepthInfo>> m_all_layers_depth;
|
||||
std::vector<WipeTowerBlock> m_wipe_tower_blocks;
|
||||
int m_last_block_id;
|
||||
|
||||
// help function
|
||||
WipeTowerBlock& get_block_by_category(int filament_category);
|
||||
void add_depth_to_block(int filament_id, int filament_category, float depth, bool is_nozzle_change = false);
|
||||
int get_filament_category(int filament_id);
|
||||
bool is_in_same_extruder(int filament_id_1, int filament_id_2);
|
||||
void reset_block_status();
|
||||
int get_wall_filament_for_all_layer();
|
||||
// for generate new wipe tower
|
||||
void generate_new(std::vector<std::vector<WipeTower::ToolChangeResult>> &result);
|
||||
|
||||
void plan_tower_new();
|
||||
void generate_wipe_tower_blocks();
|
||||
void update_start_depth_for_blocks();
|
||||
|
||||
ToolChangeResult tool_change_new(size_t new_tool);
|
||||
NozzleChangeResult nozzle_change_new(int old_filament_id, int new_filament_id);
|
||||
ToolChangeResult finish_layer_new(bool extrude_perimeter = true, bool extrude_fill = true, bool extrude_fill_wall = true);
|
||||
ToolChangeResult finish_block(int filament_id, bool extrude_perimeter = true, bool extrude_fill = true);
|
||||
void toolchange_wipe_new(WipeTowerWriter &writer, const box_coordinates &cleaning_box, float wipe_length);
|
||||
|
||||
private:
|
||||
enum wipe_shape // A fill-in direction
|
||||
{
|
||||
|
|
@ -374,6 +432,7 @@ private:
|
|||
bool m_current_layer_finished = false;
|
||||
bool m_left_to_right = true;
|
||||
float m_extra_spacing = 1.f;
|
||||
float m_tpu_fixed_spacing = 2;
|
||||
|
||||
bool is_first_layer() const { return size_t(m_layer_info - m_plan.begin()) == m_first_layer_idx; }
|
||||
|
||||
|
|
|
|||
|
|
@ -849,7 +849,7 @@ static std::vector<std::string> s_Preset_print_options {
|
|||
static std::vector<std::string> s_Preset_filament_options {
|
||||
/*"filament_colour", */ "default_filament_colour","required_nozzle_HRC","filament_diameter", "pellet_flow_coefficient", "filament_type", "filament_soluble", "filament_is_support",
|
||||
"filament_max_volumetric_speed",
|
||||
"filament_flow_ratio", "filament_density", "filament_cost", "filament_minimal_purge_on_wipe_tower",
|
||||
"filament_flow_ratio", "filament_density", "filament_category", "filament_cost", "filament_minimal_purge_on_wipe_tower",
|
||||
"nozzle_temperature", "nozzle_temperature_initial_layer",
|
||||
// BBS
|
||||
"cool_plate_temp", "textured_cool_plate_temp", "eng_plate_temp", "hot_plate_temp", "textured_plate_temp", "cool_plate_temp_initial_layer", "textured_cool_plate_temp_initial_layer", "eng_plate_temp_initial_layer", "hot_plate_temp_initial_layer", "textured_plate_temp_initial_layer", "supertack_plate_temp_initial_layer", "supertack_plate_temp",
|
||||
|
|
|
|||
|
|
@ -305,6 +305,7 @@ bool Print::invalidate_state_by_config_options(const ConfigOptionResolver & /* n
|
|||
|| opt_key == "filament_map_mode"
|
||||
|| opt_key == "filament_map"
|
||||
|| opt_key == "unprintable_filament_map"
|
||||
|| opt_key == "filament_category"
|
||||
|| opt_key == "wipe_tower_bridging"
|
||||
|| opt_key == "wipe_tower_extra_flow"
|
||||
|| opt_key == "wipe_tower_no_sparse_layers"
|
||||
|
|
@ -2832,6 +2833,8 @@ void Print::_make_wipe_tower()
|
|||
// m_wipe_tower_data.priming = Slic3r::make_unique<std::vector<WipeTower::ToolChangeResult>>(
|
||||
// wipe_tower.prime((float)this->skirt_first_layer_height(), m_wipe_tower_data.tool_ordering.all_extruders(), false));
|
||||
|
||||
std::set<int> used_filament_ids;
|
||||
|
||||
// Lets go through the wipe tower layers and determine pairs of extruder changes for each
|
||||
// to pass to wipe_tower (so that it can use it for planning the layout of the tower)
|
||||
{
|
||||
|
|
@ -2861,6 +2864,8 @@ void Print::_make_wipe_tower()
|
|||
bool first_layer = &layer_tools == &m_wipe_tower_data.tool_ordering.front();
|
||||
wipe_tower.plan_toolchange((float)layer_tools.print_z, (float)layer_tools.wipe_tower_layer_height, current_filament_id, current_filament_id);
|
||||
|
||||
used_filament_ids.insert(layer_tools.extruders.begin(), layer_tools.extruders.end());
|
||||
|
||||
for (const auto filament_id : layer_tools.extruders) {
|
||||
if (filament_id == current_filament_id)
|
||||
continue;
|
||||
|
|
@ -2898,9 +2903,17 @@ void Print::_make_wipe_tower()
|
|||
}
|
||||
}
|
||||
|
||||
wipe_tower.set_used_filament_ids(std::vector<int>(used_filament_ids.begin(), used_filament_ids.end()));
|
||||
|
||||
std::vector<int> categories;
|
||||
for (size_t i = 0; i < m_config.filament_category.values.size(); ++i) {
|
||||
categories.push_back(m_config.filament_category.get_at(i));
|
||||
}
|
||||
wipe_tower.set_filament_categories(categories);
|
||||
|
||||
// Generate the wipe tower layers.
|
||||
m_wipe_tower_data.tool_changes.reserve(m_wipe_tower_data.tool_ordering.layer_tools().size());
|
||||
wipe_tower.generate(m_wipe_tower_data.tool_changes);
|
||||
wipe_tower.generate_new(m_wipe_tower_data.tool_changes);
|
||||
m_wipe_tower_data.depth = wipe_tower.get_depth();
|
||||
m_wipe_tower_data.brim_width = wipe_tower.get_brim_width();
|
||||
|
||||
|
|
|
|||
|
|
@ -2269,6 +2269,13 @@ void PrintConfigDef::init_fff_params()
|
|||
def->mode = comAdvanced;
|
||||
def->set_default_value(new ConfigOptionPercents{ 100 });
|
||||
|
||||
def = this->add("filament_category", coInts);
|
||||
def->label = L("Category");
|
||||
def->tooltip = L("Filament category");
|
||||
def->min = 0;
|
||||
def->mode = comAdvanced;
|
||||
def->set_default_value(new ConfigOptionInts{0});
|
||||
|
||||
def = this->add("filament_loading_speed", coFloats);
|
||||
def->label = L("Loading speed");
|
||||
def->tooltip = L("Speed used for loading the filament on the wipe tower.");
|
||||
|
|
|
|||
|
|
@ -1211,6 +1211,7 @@ PRINT_CONFIG_CLASS_DEFINE(
|
|||
((ConfigOptionBool, fan_speedup_overhangs))
|
||||
((ConfigOptionFloat, fan_speedup_time))
|
||||
((ConfigOptionFloats, filament_diameter))
|
||||
((ConfigOptionInts, filament_category))
|
||||
((ConfigOptionFloats, filament_density))
|
||||
((ConfigOptionStrings, filament_type))
|
||||
((ConfigOptionBools, filament_soluble))
|
||||
|
|
|
|||
|
|
@ -3504,6 +3504,7 @@ void TabFilament::build()
|
|||
optgroup->append_single_option_line("required_nozzle_HRC");
|
||||
optgroup->append_single_option_line("default_filament_colour");
|
||||
optgroup->append_single_option_line("filament_diameter");
|
||||
optgroup->append_single_option_line("filament_category");
|
||||
|
||||
optgroup->append_single_option_line("filament_density");
|
||||
optgroup->append_single_option_line("filament_shrink");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue