mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-08-08 14:34:04 -06:00
post changes after merging BS1.7.4
Remove tracking etc..
This commit is contained in:
parent
e65b11a831
commit
2a478ab4f9
615 changed files with 46215 additions and 54844 deletions
|
@ -164,27 +164,27 @@ SlicingParameters SlicingParameters::create_from_config(
|
|||
// Convert layer_config_ranges to layer_height_profile. Both are referenced to z=0, meaning the raft layers are not accounted for
|
||||
// in the height profile and the printed object may be lifted by the raft thickness at the time of the G-code generation.
|
||||
std::vector<coordf_t> layer_height_profile_from_ranges(
|
||||
const SlicingParameters& slicing_params,
|
||||
const t_layer_config_ranges& layer_config_ranges)
|
||||
const SlicingParameters &slicing_params,
|
||||
const t_layer_config_ranges &layer_config_ranges)
|
||||
{
|
||||
// 1) If there are any height ranges, trim one by the other to make them non-overlapping. Insert the 1st layer if fixed.
|
||||
std::vector<std::pair<t_layer_height_range, coordf_t>> ranges_non_overlapping;
|
||||
std::vector<std::pair<t_layer_height_range,coordf_t>> ranges_non_overlapping;
|
||||
ranges_non_overlapping.reserve(layer_config_ranges.size() * 4);
|
||||
if (slicing_params.first_object_layer_height_fixed())
|
||||
ranges_non_overlapping.push_back(std::pair<t_layer_height_range, coordf_t>(
|
||||
t_layer_height_range(0., slicing_params.first_object_layer_height),
|
||||
ranges_non_overlapping.push_back(std::pair<t_layer_height_range,coordf_t>(
|
||||
t_layer_height_range(0., slicing_params.first_object_layer_height),
|
||||
slicing_params.first_object_layer_height));
|
||||
// The height ranges are sorted lexicographically by low / high layer boundaries.
|
||||
for (t_layer_config_ranges::const_iterator it_range = layer_config_ranges.begin(); it_range != layer_config_ranges.end(); ++it_range) {
|
||||
for (t_layer_config_ranges::const_iterator it_range = layer_config_ranges.begin(); it_range != layer_config_ranges.end(); ++ it_range) {
|
||||
coordf_t lo = it_range->first.first;
|
||||
coordf_t hi = std::min(it_range->first.second, slicing_params.object_print_z_height());
|
||||
coordf_t height = it_range->second.option("layer_height")->getFloat();
|
||||
if (!ranges_non_overlapping.empty())
|
||||
if (! ranges_non_overlapping.empty())
|
||||
// Trim current low with the last high.
|
||||
lo = std::max(lo, ranges_non_overlapping.back().first.second);
|
||||
if (lo + EPSILON < hi)
|
||||
// Ignore too narrow ranges.
|
||||
ranges_non_overlapping.push_back(std::pair<t_layer_height_range, coordf_t>(t_layer_height_range(lo, hi), height));
|
||||
ranges_non_overlapping.push_back(std::pair<t_layer_height_range,coordf_t>(t_layer_height_range(lo, hi), height));
|
||||
}
|
||||
|
||||
// 2) Convert the trimmed ranges to a height profile, fill in the undefined intervals between z=0 and z=slicing_params.object_print_z_max()
|
||||
|
@ -233,7 +233,7 @@ std::vector<coordf_t> layer_height_profile_from_ranges(
|
|||
lh_append(slicing_params.object_print_z_height(), slicing_params.layer_height);
|
||||
}
|
||||
|
||||
return layer_height_profile;
|
||||
return layer_height_profile;
|
||||
}
|
||||
|
||||
// Based on the work of @platsch
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue