Skip to content

Commit

Permalink
ENH: reduce organic tree support log level
Browse files Browse the repository at this point in the history
jira: none
Change-Id: I17b876d88974e632c592bd36f3fea700a51f86be
  • Loading branch information
ArthurBambulab authored and lanewei120 committed Jan 9, 2025
1 parent 0d1bdab commit 97de4e8
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/libslic3r/Support/TreeModelVolumes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ using namespace std::literals;

// or warning
// had to use a define beacuse the macro processing inside macro BOOST_LOG_TRIVIAL()
#define error_level_not_in_cache error
#define error_level_not_in_cache debug

//FIXME Machine border is currently ignored.
static Polygons calculateMachineBorderCollision(Polygon machine_border)
Expand Down
15 changes: 8 additions & 7 deletions src/libslic3r/Support/TreeSupport3D.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -792,7 +792,7 @@ static std::optional<std::pair<Point, size_t>> polyline_sample_next_point_at_dis
if (distance == 0)
return do_final_difference ? diff(ret, collision_trimmed()) : union_(ret);
if (safe_step_size < 0 || last_step_offset_without_check < 0) {
BOOST_LOG_TRIVIAL(error) << "Offset increase got invalid parameter!";
BOOST_LOG_TRIVIAL(warning) << "Offset increase got invalid parameter!";
tree_supports_show_error("Negative offset distance... How did you manage this ?"sv, true);
return do_final_difference ? diff(ret, collision_trimmed()) : union_(ret);
}
Expand Down Expand Up @@ -1686,7 +1686,7 @@ static Point move_inside_if_outside(const Polygons &polygons, Point from, int di
));
check_layer_data = current_elem.to_buildplate ? to_bp_data : to_model_data;
if (area(check_layer_data) < tiny_area_threshold) {
BOOST_LOG_TRIVIAL(error) << "Lost area by doing catch up from " << ceil_radius_before << " to radius " <<
BOOST_LOG_TRIVIAL(debug) << "Lost area by doing catch up from " << ceil_radius_before << " to radius " <<
volumes.ceilRadius(support_element_collision_radius(config, current_elem), settings.use_min_distance);
tree_supports_show_error("Area lost catching up radius. May not cause visible malformation."sv, true);
}
Expand Down Expand Up @@ -1983,7 +1983,7 @@ static void increase_areas_one_layer(
<< "Trying to keep area by moving faster than intended: Success";
break;
} else if (!settings.no_error)
BOOST_LOG_TRIVIAL(error) << "Trying to keep area by moving faster than intended: FAILURE! WRONG BRANCHES LIKLY!";
BOOST_LOG_TRIVIAL(warning) << "Trying to keep area by moving faster than intended: FAILURE! WRONG BRANCHES LIKLY!";
}

if (add) {
Expand Down Expand Up @@ -2447,7 +2447,7 @@ void create_layer_pathing(const TreeModelVolumes &volumes, const TreeSupportSett
return true;
if (elem.areas.to_bp_areas.empty() && elem.areas.to_model_areas.empty()) {
if (area(elem.areas.influence_areas) < tiny_area_threshold) {
BOOST_LOG_TRIVIAL(error) << "Insert Error of Influence area bypass on layer " << layer_idx - 1;
BOOST_LOG_TRIVIAL(warning) << "Insert Error of Influence area bypass on layer " << layer_idx - 1;
tree_supports_show_error("Insert error of area after bypassing merge.\n"sv, true);
}
// Move the area to output.
Expand Down Expand Up @@ -2480,7 +2480,7 @@ void create_layer_pathing(const TreeModelVolumes &volumes, const TreeSupportSett
if (! elem.areas.influence_areas.empty()) {
Polygons new_area = safe_union(elem.areas.influence_areas);
if (area(new_area) < tiny_area_threshold) {
BOOST_LOG_TRIVIAL(error) << "Insert Error of Influence area on layer " << layer_idx - 1 << ". Origin of " << elem.parents.size() << " areas. Was to bp " << elem.state.to_buildplate;
BOOST_LOG_TRIVIAL(warning) << "Insert Error of Influence area on layer " << layer_idx - 1 << ". Origin of " << elem.parents.size() << " areas. Was to bp " << elem.state.to_buildplate;
tree_supports_show_error("Insert error of area after merge.\n"sv, true);
}
this_layer.emplace_back(elem.state, std::move(elem.parents), std::move(new_area));
Expand Down Expand Up @@ -2509,7 +2509,7 @@ static void set_points_on_areas(const SupportElement &elem, SupportElements *lay

// Based on the branch center point of the current layer, the point on the next (further up) layer is calculated.
if (! elem.state.result_on_layer_is_set()) {
BOOST_LOG_TRIVIAL(error) << "Uninitialized support element";
BOOST_LOG_TRIVIAL(warning) << "Uninitialized support element";
tree_supports_show_error("Uninitialized support element. A branch may be missing.\n"sv, true);
return;
}
Expand Down Expand Up @@ -2677,7 +2677,8 @@ void create_nodes_from_area(
if (! elem.state.result_on_layer_is_set()) {
if (elem.state.to_buildplate || (elem.state.distance_to_top < config.min_dtt_to_model && ! elem.state.supports_roof)) {
if (elem.state.to_buildplate) {
BOOST_LOG_TRIVIAL(error) << "Uninitialized Influence area targeting " << elem.state.target_position.x() << "," << elem.state.target_position.y() << ") "
BOOST_LOG_TRIVIAL(warning) << "Uninitialized Influence area targeting " << elem.state.target_position.x() << "," << elem.state.target_position.y()
<< ") "
"at target_height: " << elem.state.target_height << " layer: " << layer_idx;
tree_supports_show_error("Uninitialized support element! A branch could be missing or exist partially."sv, true);
}
Expand Down

0 comments on commit 97de4e8

Please sign in to comment.