Skip to content

Commit

Permalink
Remove all references to skip_layers
Browse files Browse the repository at this point in the history
  • Loading branch information
casperlamboo committed Jan 10, 2024
1 parent a935cee commit f788722
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 17 deletions.
6 changes: 0 additions & 6 deletions include/TreeSupportSettings.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ struct TreeSupportSettings
, xy_min_distance(support_overrides == SupportDistPriority::Z_OVERRIDES_XY ? mesh_group_settings.get<coord_t>("support_xy_distance_overhang") : xy_distance)
, z_distance_top_layers(round_up_divide(mesh_group_settings.get<coord_t>("support_top_distance"), layer_height))
, z_distance_bottom_layers(round_up_divide(mesh_group_settings.get<coord_t>("support_bottom_distance"), layer_height))
, performance_interface_skip_layers(1UL)
, support_infill_angles(mesh_group_settings.get<std::vector<AngleDegrees>>("support_infill_angles"))
, support_roof_angles(mesh_group_settings.get<std::vector<AngleDegrees>>("support_roof_angles"))
, roof_pattern(mesh_group_settings.get<EFillMethod>("support_roof_pattern"))
Expand Down Expand Up @@ -268,11 +267,6 @@ struct TreeSupportSettings
*/
size_t z_distance_bottom_layers;

/*!
* \brief used for performance optimization at the support floor. Should have no impact on the resulting tree.
*/
size_t performance_interface_skip_layers;

/*!
* \brief User specified angles for the support infill.
*/
Expand Down
9 changes: 2 additions & 7 deletions src/TreeSupport.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,6 @@ TreeSupport::TreeSupport(const SliceDataStorage& storage)
{
added = true;
grouped_mesh.second.emplace_back(mesh_idx);
// Handle some settings that are only used for performance reasons. This ensures that a horrible set setting intended to improve performance can not reduce it
// drastically.
grouped_mesh.first.performance_interface_skip_layers
= std::min(grouped_mesh.first.performance_interface_skip_layers, next_settings.performance_interface_skip_layers);
}
}
if (! added)
Expand Down Expand Up @@ -2206,16 +2202,15 @@ void TreeSupport::finalizeInterfaceAndSupportAreas(std::vector<Polygons>& suppor
size_t layers_below = 0;
while (layers_below <= config.support_bottom_layers)
{
// One sample at 0 layers below, another at config.support_bottom_layers. In-between samples at config.performance_interface_skip_layers distance from each
// other.
// One sample at 0 layers below, another at config.support_bottom_layers.
const size_t sample_layer
= static_cast<size_t>(std::max(0, (static_cast<int>(layer_idx) - static_cast<int>(layers_below)) - static_cast<int>(config.z_distance_bottom_layers)));
constexpr bool no_support = false;
constexpr bool no_prime_tower = false;
floor_layer.add(layer_outset.intersection(storage.getLayerOutlines(sample_layer, no_support, no_prime_tower)));
if (layers_below < config.support_bottom_layers)
{
layers_below = std::min(layers_below + config.performance_interface_skip_layers, config.support_bottom_layers);
layers_below = std::min(layers_below + 1, config.support_bottom_layers);
}
else
{
Expand Down
6 changes: 2 additions & 4 deletions src/support.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1673,11 +1673,10 @@ void AreaSupport::generateSupportBottom(SliceDataStorage& storage, const SliceMe
return;
}
const coord_t z_distance_bottom = round_up_divide(mesh.settings.get<coord_t>("support_bottom_distance"), layer_height); // Number of layers between support bottom and model.
const size_t skip_layer_count = 1UL; // Resolution of generating support bottoms above model.
const coord_t bottom_line_width = mesh_group_settings.get<ExtruderTrain&>("support_bottom_extruder_nr").settings_.get<coord_t>("support_bottom_line_width");
const coord_t bottom_outline_offset = mesh_group_settings.get<ExtruderTrain&>("support_bottom_extruder_nr").settings_.get<coord_t>("support_bottom_offset");

const size_t scan_count = std::max(size_t(1), (bottom_layer_count - 1) / skip_layer_count); // How many measurements to take to generate bottom areas.
const size_t scan_count = std::max(size_t(1), bottom_layer_count - 1); // How many measurements to take to generate bottom areas.
const double z_skip = std::max(
1.0,
double(bottom_layer_count - 1) / double(scan_count)); // How many layers to skip between measurements. Using float for better spread, but this is later rounded.
Expand Down Expand Up @@ -1709,11 +1708,10 @@ void AreaSupport::generateSupportRoof(SliceDataStorage& storage, const SliceMesh
return;
}
const coord_t z_distance_top = round_up_divide(mesh.settings.get<coord_t>("support_top_distance"), layer_height); // Number of layers between support roof and model.
const size_t skip_layer_count = 1UL; // Resolution of generating support roof below model.
const coord_t roof_line_width = mesh_group_settings.get<ExtruderTrain&>("support_roof_extruder_nr").settings_.get<coord_t>("support_roof_line_width");
const coord_t roof_outline_offset = mesh_group_settings.get<ExtruderTrain&>("support_roof_extruder_nr").settings_.get<coord_t>("support_roof_offset");

const size_t scan_count = std::max(size_t(1), (roof_layer_count - 1) / skip_layer_count); // How many measurements to take to generate roof areas.
const size_t scan_count = std::max(size_t(1), roof_layer_count - 1); // How many measurements to take to generate roof areas.
const double z_skip = std::max(
1.0,
double(roof_layer_count - 1) / double(scan_count)); // How many layers to skip between measurements. Using float for better spread, but this is later rounded.
Expand Down

0 comments on commit f788722

Please sign in to comment.