mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-07-24 19:32:18 +00:00
Merge some BS1.7 changes:
internal_solid_infill_pattern
This commit is contained in:
@@ -108,6 +108,21 @@ template<class IndexT> struct ItsNeighborsWrapper
|
||||
const auto& get_index() const noexcept { return index_ref; }
|
||||
};
|
||||
|
||||
// Can be used as the second argument to its_split to apply a functor on each
|
||||
// part, instead of collecting them into a container.
|
||||
template<class Fn>
|
||||
struct SplitOutputFn {
|
||||
|
||||
Fn fn;
|
||||
|
||||
SplitOutputFn(Fn f): fn{std::move(f)} {}
|
||||
|
||||
SplitOutputFn &operator *() { return *this; }
|
||||
void operator=(indexed_triangle_set &&its) { fn(std::move(its)); }
|
||||
void operator=(indexed_triangle_set &its) { fn(its); }
|
||||
SplitOutputFn& operator++() { return *this; };
|
||||
};
|
||||
|
||||
// Splits a mesh into multiple meshes when possible.
|
||||
template<class Its, class OutputIt>
|
||||
void its_split(const Its &m, OutputIt out_it)
|
||||
@@ -155,7 +170,8 @@ void its_split(const Its &m, OutputIt out_it)
|
||||
mesh.indices.emplace_back(new_face);
|
||||
}
|
||||
|
||||
out_it = std::move(mesh);
|
||||
*out_it = std::move(mesh);
|
||||
++out_it;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user