mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-10-20 22:18:30 +00:00
Merge branch 'main' into perf/slicing-optimizations
This commit is contained in:
commit
f6e8821b13
47 files changed
+2419
-59
No files matched your search
@@ -31,6 +31,7 @@
|
||||
#include "Fill/FillAdaptive.hpp"
|
||||
#include "Fill/Fill.hpp"
|
||||
#include "Fill/FillLightning.hpp"
|
||||
#include "Fill/FillTpmsAdaptive.hpp"
|
||||
#include "format.hpp"
|
||||
#include "AABBTreeIndirect.hpp"
|
||||
#include "AABBTreeLines.hpp"
|
||||
@@ -1299,6 +1300,38 @@ FillLightning::GeneratorPtr PrintObject::prepare_lightning_infill_data()
|
||||
return has_lightning_infill ? FillLightning::build_generator(std::as_const(*this), [this]() -> void { this->throw_if_canceled(); }) : FillLightning::GeneratorPtr();
|
||||
}
|
||||
|
||||
TpmsRadialFields PrintObject::prepare_tpms_radial_fields() const
|
||||
{
|
||||
TpmsRadialFields fields;
|
||||
std::array<bool, size_t(TpmsAdaptiveMode::Count)> modes{};
|
||||
for (size_t region_id = 0; region_id < this->num_printing_regions(); ++region_id)
|
||||
if (const PrintRegionConfig &config = this->printing_region(region_id).config();
|
||||
config.sparse_infill_density > 0 && config.sparse_infill_density < 100 && is_tpms_adaptive_pattern(config.sparse_infill_pattern))
|
||||
modes[size_t(config.tpms_adaptive.value)] = true;
|
||||
modes[size_t(TpmsAdaptiveMode::Disabled)] = false;
|
||||
if (std::find(modes.begin(), modes.end(), true) == modes.end() || m_layers.empty())
|
||||
return fields;
|
||||
|
||||
std::vector<TpmsRadialField::Slice> slices;
|
||||
slices.reserve(m_layers.size());
|
||||
BoundingBox bbox;
|
||||
for (const Layer *layer : m_layers) {
|
||||
slices.push_back({layer->bottom_z(), layer->print_z, &layer->lslices});
|
||||
bbox.merge(get_extents(layer->lslices));
|
||||
}
|
||||
if (!bbox.defined)
|
||||
return fields;
|
||||
for (size_t mode = 0; mode < modes.size(); ++mode) {
|
||||
if (!modes[mode])
|
||||
continue;
|
||||
// Without a field, the infill falls back to the regular pattern.
|
||||
auto field = std::make_unique<TpmsRadialField>(slices, bbox, TpmsAdaptiveMode(mode), [this]() { m_print->throw_if_canceled(); });
|
||||
if (!field->empty())
|
||||
fields[mode] = std::move(field);
|
||||
}
|
||||
return fields;
|
||||
}
|
||||
|
||||
void PrintObject::clear_layers()
|
||||
{
|
||||
if (!m_shared_object) {
|
||||
@@ -1702,6 +1735,9 @@ bool PrintObject::invalidate_state_by_config_options(
|
||||
|| opt_key == "infill_overhang_angle") {
|
||||
steps.emplace_back(posInfill);
|
||||
} else if (opt_key == "sparse_infill_pattern"
|
||||
|| opt_key == "tpms_adaptive"
|
||||
|| opt_key == "tpms_interior_density"
|
||||
|| opt_key == "tpms_adaptive_gradient"
|
||||
// Orca: Body centering now also determines bridge anchors during preparation.
|
||||
// Invalidating preparation also invalidates infill, including top/bottom surfaces.
|
||||
|| opt_key == "center_of_surface_pattern"
|
||||
@@ -3320,6 +3356,7 @@ void PrintObject::bridge_over_infill()
|
||||
}
|
||||
|
||||
this->m_adaptive_fill_octrees = this->prepare_adaptive_infill_data(surfaces_w_layer);
|
||||
this->m_tpms_radial_fields = this->prepare_tpms_radial_fields();
|
||||
|
||||
std::vector<size_t> layers_to_generate_infill;
|
||||
for (const auto &pair : surfaces_by_layer) {
|
||||
|
||||
Reference in new issue
Block a user