mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-05-08 04:49:11 +08:00
Wipe tower generator should now work for more than 4 extruders (actual number extracted from wiping_volumes_matrix)
This commit is contained in:
parent
a782424d5f
commit
0fc2da5a32
@ -69,19 +69,19 @@ public:
|
|||||||
m_cooling_tube_retraction(cooling_tube_retraction),
|
m_cooling_tube_retraction(cooling_tube_retraction),
|
||||||
m_cooling_tube_length(cooling_tube_length),
|
m_cooling_tube_length(cooling_tube_length),
|
||||||
m_parking_pos_retraction(parking_pos_retraction),
|
m_parking_pos_retraction(parking_pos_retraction),
|
||||||
m_current_tool(initial_tool),
|
m_bridging(bridging),
|
||||||
m_bridging(bridging)
|
m_current_tool(initial_tool)
|
||||||
{
|
{
|
||||||
const unsigned int number_of_extruders = int(sqrt(wiping_matrix.size())+WT_EPSILON);
|
const unsigned int number_of_extruders = int(sqrt(wiping_matrix.size())+WT_EPSILON);
|
||||||
for (unsigned int i = 0; i<number_of_extruders; ++i)
|
for (unsigned int i = 0; i<number_of_extruders; ++i)
|
||||||
wipe_volumes.push_back(std::vector<float>(wiping_matrix.begin()+i*number_of_extruders,wiping_matrix.begin()+(i+1)*number_of_extruders));
|
wipe_volumes.push_back(std::vector<float>(wiping_matrix.begin()+i*number_of_extruders,wiping_matrix.begin()+(i+1)*number_of_extruders));
|
||||||
|
|
||||||
for (size_t i = 0; i < 4; ++ i) {
|
/*for (size_t i = 0; i < number_of_extruders; ++ i) {
|
||||||
// Extruder specific parameters.
|
// Extruder specific parameters.
|
||||||
m_filpar[i].material = PLA;
|
m_filpar[i].material = PLA;
|
||||||
m_filpar[i].temperature = 0;
|
m_filpar[i].temperature = 0;
|
||||||
m_filpar[i].first_layer_temperature = 0;
|
m_filpar[i].first_layer_temperature = 0;
|
||||||
}
|
}*/
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual ~WipeTowerPrusaMM() {}
|
virtual ~WipeTowerPrusaMM() {}
|
||||||
@ -97,6 +97,8 @@ public:
|
|||||||
void set_extruder(size_t idx, material_type material, int temp, int first_layer_temp, float loading_speed,
|
void set_extruder(size_t idx, material_type material, int temp, int first_layer_temp, float loading_speed,
|
||||||
float unloading_speed, float delay, int cooling_time, std::string ramming_parameters)
|
float unloading_speed, float delay, int cooling_time, std::string ramming_parameters)
|
||||||
{
|
{
|
||||||
|
while (m_filpar.size() < idx+1) // makes sure the required element is in the vector
|
||||||
|
m_filpar.push_back(FilamentParameters());
|
||||||
m_filpar[idx].material = material;
|
m_filpar[idx].material = material;
|
||||||
m_filpar[idx].temperature = temp;
|
m_filpar[idx].temperature = temp;
|
||||||
m_filpar[idx].first_layer_temperature = first_layer_temp;
|
m_filpar[idx].first_layer_temperature = first_layer_temp;
|
||||||
@ -226,20 +228,20 @@ private:
|
|||||||
|
|
||||||
|
|
||||||
struct FilamentParameters {
|
struct FilamentParameters {
|
||||||
material_type material;
|
material_type material = PLA;
|
||||||
int temperature;
|
int temperature = 0;
|
||||||
int first_layer_temperature;
|
int first_layer_temperature = 0;
|
||||||
float loading_speed;
|
float loading_speed = 0.f;
|
||||||
float unloading_speed;
|
float unloading_speed = 0.f;
|
||||||
float delay;
|
float delay = 0.f ;
|
||||||
int cooling_time;
|
int cooling_time = 0;
|
||||||
float ramming_line_width_multiplicator;
|
float ramming_line_width_multiplicator = 0.f;
|
||||||
float ramming_step_multiplicator;
|
float ramming_step_multiplicator = 0.f;
|
||||||
std::vector<float> ramming_speed;
|
std::vector<float> ramming_speed;
|
||||||
};
|
};
|
||||||
|
|
||||||
// Extruder specific parameters.
|
// Extruder specific parameters.
|
||||||
FilamentParameters m_filpar[4];
|
std::vector<FilamentParameters> m_filpar;
|
||||||
|
|
||||||
|
|
||||||
// State of the wiper tower generator.
|
// State of the wiper tower generator.
|
||||||
|
@ -1037,21 +1037,22 @@ void Print::_make_wipe_tower()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Get wiping matrix to get number of extruders and convert vector<double> to vector<float>:
|
||||||
|
std::vector<float> wiping_volumes((this->config.wiping_volumes_matrix.values).begin(),(this->config.wiping_volumes_matrix.values).end());
|
||||||
|
|
||||||
// Initialize the wipe tower.
|
// Initialize the wipe tower.
|
||||||
WipeTowerPrusaMM wipe_tower(
|
WipeTowerPrusaMM wipe_tower(
|
||||||
float(this->config.wipe_tower_x.value), float(this->config.wipe_tower_y.value),
|
float(this->config.wipe_tower_x.value), float(this->config.wipe_tower_y.value),
|
||||||
float(this->config.wipe_tower_width.value), float(this->config.wipe_tower_per_color_wipe.value),
|
float(this->config.wipe_tower_width.value), float(this->config.wipe_tower_per_color_wipe.value),
|
||||||
float(this->config.wipe_tower_rotation_angle.value), float(this->config.cooling_tube_retraction.value),
|
float(this->config.wipe_tower_rotation_angle.value), float(this->config.cooling_tube_retraction.value),
|
||||||
float(this->config.cooling_tube_length.value), float(this->config.parking_pos_retraction.value),
|
float(this->config.cooling_tube_length.value), float(this->config.parking_pos_retraction.value),
|
||||||
float(this->config.wipe_tower_bridging),
|
float(this->config.wipe_tower_bridging), wiping_volumes, m_tool_ordering.first_extruder());
|
||||||
std::vector<float>((this->config.wiping_volumes_matrix.values).begin(),(this->config.wiping_volumes_matrix.values).end()),
|
|
||||||
m_tool_ordering.first_extruder());
|
|
||||||
|
|
||||||
//wipe_tower.set_retract();
|
//wipe_tower.set_retract();
|
||||||
//wipe_tower.set_zhop();
|
//wipe_tower.set_zhop();
|
||||||
|
|
||||||
// Set the extruder & material properties at the wipe tower object.
|
// Set the extruder & material properties at the wipe tower object.
|
||||||
for (size_t i = 0; i < 4; ++ i)
|
for (size_t i = 0; i < (int)(sqrt(wiping_volumes.size())+EPSILON); ++ i)
|
||||||
wipe_tower.set_extruder(
|
wipe_tower.set_extruder(
|
||||||
i,
|
i,
|
||||||
WipeTowerPrusaMM::parse_material(this->config.filament_type.get_at(i).c_str()),
|
WipeTowerPrusaMM::parse_material(this->config.filament_type.get_at(i).c_str()),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user