Tech ENABLE_SPIRAL_VASE_LAYERS set as default
This commit is contained in:
parent
8d5dd759ad
commit
fb22612d0d
@ -737,9 +737,7 @@ void GCodeProcessorResult::reset() {
|
|||||||
filament_diameters = std::vector<float>(MIN_EXTRUDERS_COUNT, DEFAULT_FILAMENT_DIAMETER);
|
filament_diameters = std::vector<float>(MIN_EXTRUDERS_COUNT, DEFAULT_FILAMENT_DIAMETER);
|
||||||
filament_densities = std::vector<float>(MIN_EXTRUDERS_COUNT, DEFAULT_FILAMENT_DENSITY);
|
filament_densities = std::vector<float>(MIN_EXTRUDERS_COUNT, DEFAULT_FILAMENT_DENSITY);
|
||||||
custom_gcode_per_print_z = std::vector<CustomGCode::Item>();
|
custom_gcode_per_print_z = std::vector<CustomGCode::Item>();
|
||||||
#if ENABLE_SPIRAL_VASE_LAYERS
|
|
||||||
spiral_vase_layers = std::vector<std::pair<float, std::pair<size_t, size_t>>>();
|
spiral_vase_layers = std::vector<std::pair<float, std::pair<size_t, size_t>>>();
|
||||||
#endif // ENABLE_SPIRAL_VASE_LAYERS
|
|
||||||
time = 0;
|
time = 0;
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
@ -755,9 +753,7 @@ void GCodeProcessorResult::reset() {
|
|||||||
filament_diameters = std::vector<float>(MIN_EXTRUDERS_COUNT, DEFAULT_FILAMENT_DIAMETER);
|
filament_diameters = std::vector<float>(MIN_EXTRUDERS_COUNT, DEFAULT_FILAMENT_DIAMETER);
|
||||||
filament_densities = std::vector<float>(MIN_EXTRUDERS_COUNT, DEFAULT_FILAMENT_DENSITY);
|
filament_densities = std::vector<float>(MIN_EXTRUDERS_COUNT, DEFAULT_FILAMENT_DENSITY);
|
||||||
custom_gcode_per_print_z = std::vector<CustomGCode::Item>();
|
custom_gcode_per_print_z = std::vector<CustomGCode::Item>();
|
||||||
#if ENABLE_SPIRAL_VASE_LAYERS
|
|
||||||
spiral_vase_layers = std::vector<std::pair<float, std::pair<size_t, size_t>>>();
|
spiral_vase_layers = std::vector<std::pair<float, std::pair<size_t, size_t>>>();
|
||||||
#endif // ENABLE_SPIRAL_VASE_LAYERS
|
|
||||||
}
|
}
|
||||||
#endif // ENABLE_GCODE_VIEWER_STATISTICS
|
#endif // ENABLE_GCODE_VIEWER_STATISTICS
|
||||||
|
|
||||||
@ -905,11 +901,9 @@ void GCodeProcessor::apply_config(const PrintConfig& config)
|
|||||||
|
|
||||||
m_result.max_print_height = config.max_print_height;
|
m_result.max_print_height = config.max_print_height;
|
||||||
|
|
||||||
#if ENABLE_SPIRAL_VASE_LAYERS
|
|
||||||
const ConfigOptionBool* spiral_vase = config.option<ConfigOptionBool>("spiral_vase");
|
const ConfigOptionBool* spiral_vase = config.option<ConfigOptionBool>("spiral_vase");
|
||||||
if (spiral_vase != nullptr)
|
if (spiral_vase != nullptr)
|
||||||
m_spiral_vase_active = spiral_vase->value;
|
m_spiral_vase_active = spiral_vase->value;
|
||||||
#endif // ENABLE_SPIRAL_VASE_LAYERS
|
|
||||||
|
|
||||||
#if ENABLE_Z_OFFSET_CORRECTION
|
#if ENABLE_Z_OFFSET_CORRECTION
|
||||||
const ConfigOptionFloat* z_offset = config.option<ConfigOptionFloat>("z_offset");
|
const ConfigOptionFloat* z_offset = config.option<ConfigOptionFloat>("z_offset");
|
||||||
@ -1160,11 +1154,9 @@ void GCodeProcessor::apply_config(const DynamicPrintConfig& config)
|
|||||||
if (max_print_height != nullptr)
|
if (max_print_height != nullptr)
|
||||||
m_result.max_print_height = max_print_height->value;
|
m_result.max_print_height = max_print_height->value;
|
||||||
|
|
||||||
#if ENABLE_SPIRAL_VASE_LAYERS
|
|
||||||
const ConfigOptionBool* spiral_vase = config.option<ConfigOptionBool>("spiral_vase");
|
const ConfigOptionBool* spiral_vase = config.option<ConfigOptionBool>("spiral_vase");
|
||||||
if (spiral_vase != nullptr)
|
if (spiral_vase != nullptr)
|
||||||
m_spiral_vase_active = spiral_vase->value;
|
m_spiral_vase_active = spiral_vase->value;
|
||||||
#endif // ENABLE_SPIRAL_VASE_LAYERS
|
|
||||||
|
|
||||||
#if ENABLE_Z_OFFSET_CORRECTION
|
#if ENABLE_Z_OFFSET_CORRECTION
|
||||||
const ConfigOptionFloat* z_offset = config.option<ConfigOptionFloat>("z_offset");
|
const ConfigOptionFloat* z_offset = config.option<ConfigOptionFloat>("z_offset");
|
||||||
@ -1238,9 +1230,7 @@ void GCodeProcessor::reset()
|
|||||||
|
|
||||||
m_options_z_corrector.reset();
|
m_options_z_corrector.reset();
|
||||||
|
|
||||||
#if ENABLE_SPIRAL_VASE_LAYERS
|
|
||||||
m_spiral_vase_active = false;
|
m_spiral_vase_active = false;
|
||||||
#endif // ENABLE_SPIRAL_VASE_LAYERS
|
|
||||||
|
|
||||||
#if ENABLE_GCODE_VIEWER_DATA_CHECKING
|
#if ENABLE_GCODE_VIEWER_DATA_CHECKING
|
||||||
m_mm3_per_mm_compare.reset();
|
m_mm3_per_mm_compare.reset();
|
||||||
@ -1950,7 +1940,6 @@ void GCodeProcessor::process_tags(const std::string_view comment, bool producers
|
|||||||
// layer change tag
|
// layer change tag
|
||||||
if (comment == reserved_tag(ETags::Layer_Change)) {
|
if (comment == reserved_tag(ETags::Layer_Change)) {
|
||||||
++m_layer_id;
|
++m_layer_id;
|
||||||
#if ENABLE_SPIRAL_VASE_LAYERS
|
|
||||||
if (m_spiral_vase_active) {
|
if (m_spiral_vase_active) {
|
||||||
if (m_result.moves.empty())
|
if (m_result.moves.empty())
|
||||||
m_result.spiral_vase_layers.push_back({ m_first_layer_height, { 0, 0 } });
|
m_result.spiral_vase_layers.push_back({ m_first_layer_height, { 0, 0 } });
|
||||||
@ -1962,7 +1951,6 @@ void GCodeProcessor::process_tags(const std::string_view comment, bool producers
|
|||||||
m_result.spiral_vase_layers.push_back({ static_cast<float>(m_end_position[Z]), { move_id, move_id } });
|
m_result.spiral_vase_layers.push_back({ static_cast<float>(m_end_position[Z]), { move_id, move_id } });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif // ENABLE_SPIRAL_VASE_LAYERS
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2772,10 +2760,8 @@ void GCodeProcessor::process_G1(const GCodeReader::GCodeLine& line)
|
|||||||
m_seams_detector.set_first_vertex(m_result.moves.back().position - m_extruder_offsets[m_extruder_id]);
|
m_seams_detector.set_first_vertex(m_result.moves.back().position - m_extruder_offsets[m_extruder_id]);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if ENABLE_SPIRAL_VASE_LAYERS
|
|
||||||
if (m_spiral_vase_active && !m_result.spiral_vase_layers.empty() && !m_result.moves.empty())
|
if (m_spiral_vase_active && !m_result.spiral_vase_layers.empty() && !m_result.moves.empty())
|
||||||
m_result.spiral_vase_layers.back().second.second = m_result.moves.size() - 1;
|
m_result.spiral_vase_layers.back().second.second = m_result.moves.size() - 1;
|
||||||
#endif // ENABLE_SPIRAL_VASE_LAYERS
|
|
||||||
|
|
||||||
// store move
|
// store move
|
||||||
store_move_vertex(type);
|
store_move_vertex(type);
|
||||||
|
@ -131,9 +131,7 @@ namespace Slic3r {
|
|||||||
std::vector<float> filament_densities;
|
std::vector<float> filament_densities;
|
||||||
PrintEstimatedStatistics print_statistics;
|
PrintEstimatedStatistics print_statistics;
|
||||||
std::vector<CustomGCode::Item> custom_gcode_per_print_z;
|
std::vector<CustomGCode::Item> custom_gcode_per_print_z;
|
||||||
#if ENABLE_SPIRAL_VASE_LAYERS
|
|
||||||
std::vector<std::pair<float, std::pair<size_t, size_t>>> spiral_vase_layers;
|
std::vector<std::pair<float, std::pair<size_t, size_t>>> spiral_vase_layers;
|
||||||
#endif // ENABLE_SPIRAL_VASE_LAYERS
|
|
||||||
|
|
||||||
#if ENABLE_GCODE_VIEWER_STATISTICS
|
#if ENABLE_GCODE_VIEWER_STATISTICS
|
||||||
int64_t time{ 0 };
|
int64_t time{ 0 };
|
||||||
@ -559,9 +557,7 @@ namespace Slic3r {
|
|||||||
SeamsDetector m_seams_detector;
|
SeamsDetector m_seams_detector;
|
||||||
OptionsZCorrector m_options_z_corrector;
|
OptionsZCorrector m_options_z_corrector;
|
||||||
size_t m_last_default_color_id;
|
size_t m_last_default_color_id;
|
||||||
#if ENABLE_SPIRAL_VASE_LAYERS
|
|
||||||
bool m_spiral_vase_active;
|
bool m_spiral_vase_active;
|
||||||
#endif // ENABLE_SPIRAL_VASE_LAYERS
|
|
||||||
#if ENABLE_GCODE_VIEWER_STATISTICS
|
#if ENABLE_GCODE_VIEWER_STATISTICS
|
||||||
std::chrono::time_point<std::chrono::high_resolution_clock> m_start_time;
|
std::chrono::time_point<std::chrono::high_resolution_clock> m_start_time;
|
||||||
#endif // ENABLE_GCODE_VIEWER_STATISTICS
|
#endif // ENABLE_GCODE_VIEWER_STATISTICS
|
||||||
|
@ -41,8 +41,6 @@
|
|||||||
//================
|
//================
|
||||||
#define ENABLE_2_4_1_RC 1
|
#define ENABLE_2_4_1_RC 1
|
||||||
|
|
||||||
// Enable detection of layers for spiral vase prints
|
|
||||||
#define ENABLE_SPIRAL_VASE_LAYERS (1 && ENABLE_2_4_1_RC)
|
|
||||||
// Enable correction of toolpaths when z offset is set
|
// Enable correction of toolpaths when z offset is set
|
||||||
#define ENABLE_Z_OFFSET_CORRECTION (1 && ENABLE_2_4_1_RC)
|
#define ENABLE_Z_OFFSET_CORRECTION (1 && ENABLE_2_4_1_RC)
|
||||||
|
|
||||||
|
@ -2313,7 +2313,6 @@ void GCodeViewer::load_toolpaths(const GCodeProcessorResult& gcode_result)
|
|||||||
sort_remove_duplicates(m_extruder_ids);
|
sort_remove_duplicates(m_extruder_ids);
|
||||||
m_extruder_ids.shrink_to_fit();
|
m_extruder_ids.shrink_to_fit();
|
||||||
|
|
||||||
#if ENABLE_SPIRAL_VASE_LAYERS
|
|
||||||
// replace layers for spiral vase mode
|
// replace layers for spiral vase mode
|
||||||
if (!gcode_result.spiral_vase_layers.empty()) {
|
if (!gcode_result.spiral_vase_layers.empty()) {
|
||||||
m_layers.reset();
|
m_layers.reset();
|
||||||
@ -2321,7 +2320,6 @@ void GCodeViewer::load_toolpaths(const GCodeProcessorResult& gcode_result)
|
|||||||
m_layers.append(layer.first, { layer.second.first, layer.second.second });
|
m_layers.append(layer.first, { layer.second.first, layer.second.second });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif // ENABLE_SPIRAL_VASE_LAYERS
|
|
||||||
|
|
||||||
// set layers z range
|
// set layers z range
|
||||||
if (!m_layers.empty())
|
if (!m_layers.empty())
|
||||||
|
Loading…
Reference in New Issue
Block a user