mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-07-25 03:42:05 +00:00
add filament_extruder_map (#148)
This commit is contained in:
@@ -213,42 +213,93 @@ double Flow::mm3_per_mm() const
|
||||
|
||||
Flow support_material_flow(const PrintObject *object, float layer_height)
|
||||
{
|
||||
// SM Orca: 使用物理挤出机的喷嘴直径
|
||||
int filament_idx = object->config().support_filament - 1;
|
||||
int physical_extruder = object->print()->get_physical_extruder(filament_idx);
|
||||
|
||||
// SM Orca: 日志 - 配置数组访问边界检查
|
||||
const auto& nozzle_diameter_config = object->print()->config().nozzle_diameter;
|
||||
size_t array_size = nozzle_diameter_config.values.size();
|
||||
BOOST_LOG_TRIVIAL(info) << "Flow::support_material_flow: filament_idx=" << filament_idx
|
||||
<< " physical_extruder=" << physical_extruder
|
||||
<< " nozzle_diameter array_size=" << array_size
|
||||
<< " access_index=" << physical_extruder
|
||||
<< (physical_extruder >= (int)array_size ? " [POTENTIAL_OUT_OF_BOUNDS!]" : " [OK]");
|
||||
|
||||
return Flow::new_from_config_width(
|
||||
frSupportMaterial,
|
||||
// The width parameter accepted by new_from_config_width is of type ConfigOptionFloatOrPercent, the Flow class takes care of the percent to value substitution.
|
||||
(object->config().support_line_width.value > 0) ? object->config().support_line_width : object->config().line_width,
|
||||
// if object->config().support_filament == 0 (which means to not trigger tool change, but use the current extruder instead), get_at will return the 0th component.
|
||||
float(object->print()->config().nozzle_diameter.get_at(object->config().support_filament-1)),
|
||||
float(object->print()->config().nozzle_diameter.get_at(physical_extruder)),
|
||||
(layer_height > 0.f) ? layer_height : float(object->config().layer_height.value));
|
||||
}
|
||||
//BBS
|
||||
Flow support_transition_flow(const PrintObject* object)
|
||||
{
|
||||
//BBS: support transition of tree support is bridge flow
|
||||
float dmr = float(object->print()->config().nozzle_diameter.get_at(object->config().support_filament - 1));
|
||||
// SM Orca: 使用物理挤出机的喷嘴直径
|
||||
int filament_idx = object->config().support_filament - 1;
|
||||
int physical_extruder = object->print()->get_physical_extruder(filament_idx);
|
||||
|
||||
// SM Orca: 日志 - 配置数组访问边界检查
|
||||
const auto& nozzle_diameter_config = object->print()->config().nozzle_diameter;
|
||||
size_t array_size = nozzle_diameter_config.values.size();
|
||||
BOOST_LOG_TRIVIAL(info) << "Flow::support_transition_flow: filament_idx=" << filament_idx
|
||||
<< " physical_extruder=" << physical_extruder
|
||||
<< " nozzle_diameter array_size=" << array_size
|
||||
<< " access_index=" << physical_extruder
|
||||
<< (physical_extruder >= (int)array_size ? " [POTENTIAL_OUT_OF_BOUNDS!]" : " [OK]");
|
||||
|
||||
float dmr = float(object->print()->config().nozzle_diameter.get_at(physical_extruder));
|
||||
return Flow::bridging_flow(dmr, dmr);
|
||||
}
|
||||
|
||||
Flow support_material_1st_layer_flow(const PrintObject *object, float layer_height)
|
||||
{
|
||||
// SM Orca: 使用物理挤出机的喷嘴直径
|
||||
int filament_idx = object->config().support_filament - 1;
|
||||
int physical_extruder = object->print()->get_physical_extruder(filament_idx);
|
||||
const PrintConfig &print_config = object->print()->config();
|
||||
|
||||
// SM Orca: 日志 - 配置数组访问边界检查
|
||||
size_t array_size = print_config.nozzle_diameter.values.size();
|
||||
BOOST_LOG_TRIVIAL(info) << "Flow::support_material_1st_layer_flow: filament_idx=" << filament_idx
|
||||
<< " physical_extruder=" << physical_extruder
|
||||
<< " nozzle_diameter array_size=" << array_size
|
||||
<< " access_index=" << physical_extruder
|
||||
<< (physical_extruder >= (int)array_size ? " [POTENTIAL_OUT_OF_BOUNDS!]" : " [OK]");
|
||||
|
||||
const auto &width = (print_config.initial_layer_line_width.value > 0) ? print_config.initial_layer_line_width : object->config().support_line_width;
|
||||
return Flow::new_from_config_width(
|
||||
frSupportMaterial,
|
||||
// The width parameter accepted by new_from_config_width is of type ConfigOptionFloatOrPercent, the Flow class takes care of the percent to value substitution.
|
||||
(width.value > 0) ? width : object->config().line_width,
|
||||
float(print_config.nozzle_diameter.get_at(object->config().support_filament-1)),
|
||||
float(print_config.nozzle_diameter.get_at(physical_extruder)),
|
||||
(layer_height > 0.f) ? layer_height : float(print_config.initial_layer_print_height.value));
|
||||
}
|
||||
|
||||
Flow support_material_interface_flow(const PrintObject *object, float layer_height)
|
||||
{
|
||||
// SM Orca: 使用物理挤出机的喷嘴直径
|
||||
int filament_idx = object->config().support_interface_filament - 1;
|
||||
int physical_extruder = object->print()->get_physical_extruder(filament_idx);
|
||||
|
||||
// SM Orca: 日志 - 配置数组访问边界检查
|
||||
const auto& nozzle_diameter_config = object->print()->config().nozzle_diameter;
|
||||
size_t array_size = nozzle_diameter_config.values.size();
|
||||
BOOST_LOG_TRIVIAL(info) << "Flow::support_material_interface_flow: filament_idx=" << filament_idx
|
||||
<< " physical_extruder=" << physical_extruder
|
||||
<< " nozzle_diameter array_size=" << array_size
|
||||
<< " access_index=" << physical_extruder
|
||||
<< (physical_extruder >= (int)array_size ? " [POTENTIAL_OUT_OF_BOUNDS!]" : " [OK]");
|
||||
|
||||
return Flow::new_from_config_width(
|
||||
frSupportMaterialInterface,
|
||||
// The width parameter accepted by new_from_config_width is of type ConfigOptionFloatOrPercent, the Flow class takes care of the percent to value substitution.
|
||||
(object->config().support_line_width > 0) ? object->config().support_line_width : object->config().line_width,
|
||||
// if object->config().support_interface_filament == 0 (which means to not trigger tool change, but use the current extruder instead), get_at will return the 0th component.
|
||||
float(object->print()->config().nozzle_diameter.get_at(object->config().support_interface_filament-1)),
|
||||
float(object->print()->config().nozzle_diameter.get_at(physical_extruder)),
|
||||
(layer_height > 0.f) ? layer_height : float(object->config().layer_height.value));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user