Merge prusa 2.6.1

This commit is contained in:
QIDI TECH
2023-09-16 16:26:29 +08:00
parent 1338e60f8b
commit 963e22db99
203 changed files with 25254 additions and 6453 deletions

View File

@@ -1,8 +1,10 @@
#ifndef CSGMESH_HPP
#define CSGMESH_HPP
#include "libslic3r/Point.hpp"
#include <libslic3r/AnyPtr.hpp>
#include <admesh/stl.h>
#include <libslic3r/TriangleMesh.hpp>
namespace Slic3r { namespace csg {
@@ -81,6 +83,35 @@ struct CSGPart {
{}
};
template<class Cont> bool is_all_positive(const Cont &csgmesh)
{
bool is_all_pos =
std::all_of(csgmesh.begin(),
csgmesh.end(),
[](auto &part) {
return csg::get_operation(part) == csg::CSGType::Union;
});
return is_all_pos;
}
template<class Cont>
indexed_triangle_set csgmesh_merge_positive_parts(const Cont &csgmesh)
{
indexed_triangle_set m;
for (auto &csgpart : csgmesh) {
auto op = csg::get_operation(csgpart);
const indexed_triangle_set * pmesh = csg::get_mesh(csgpart);
if (pmesh && op == csg::CSGType::Union) {
indexed_triangle_set mcpy = *pmesh;
its_transform(mcpy, csg::get_transform(csgpart), true);
its_merge(m, mcpy);
}
}
return m;
}
}} // namespace Slic3r::csg
#endif // CSGMESH_HPP

View File

@@ -155,10 +155,10 @@ It check_csgmesh_booleans(const Range<It> &csgrange, Visitor &&vfn)
if (!m || MeshBoolean::cgal::empty(*m))
return;
if (!MeshBoolean::cgal::does_bound_a_volume(*m))
if (MeshBoolean::cgal::does_self_intersect(*m))
return;
if (MeshBoolean::cgal::does_self_intersect(*m))
if (!MeshBoolean::cgal::does_bound_a_volume(*m))
return;
}
catch (...) { return; }