Prusa Slicer 2.6.0
Loading...
Searching...
No Matches
Slic3r::csg::detail_cgal Namespace Reference

Functions

void perform_csg (CSGType op, CGALMeshPtr &dst, CGALMeshPtr &src)
 
template<class Ex , class It >
std::vector< CGALMeshPtr > get_cgalptrs (Ex policy, const Range< It > &csgrange)
 

Function Documentation

◆ get_cgalptrs()

template<class Ex , class It >
std::vector< CGALMeshPtr > Slic3r::csg::detail_cgal::get_cgalptrs ( Ex  policy,
const Range< It > &  csgrange 
)
70{
71 std::vector<CGALMeshPtr> ret(csgrange.size());
72 execution::for_each(policy, size_t(0), csgrange.size(),
73 [&csgrange, &ret](size_t i) {
74 auto it = csgrange.begin();
75 std::advance(it, i);
76 auto &csgpart = *it;
77 ret[i] = get_cgalmesh(csgpart);
78 });
79
80 return ret;
81}
size_t size() const
Definition libslic3r.h:352

References Slic3r::execution::for_each(), and Slic3r::Range< It >::size().

+ Here is the call graph for this function:

◆ perform_csg()

void Slic3r::csg::detail_cgal::perform_csg ( CSGType  op,
CGALMeshPtr &  dst,
CGALMeshPtr &  src 
)
inline
46{
47 if (!dst && op == CSGType::Union && src) {
48 dst = std::move(src);
49 return;
50 }
51
52 if (!dst || !src)
53 return;
54
55 switch (op) {
56 case CSGType::Union:
57 MeshBoolean::cgal::plus(*dst, *src);
58 break;
59 case CSGType::Difference:
60 MeshBoolean::cgal::minus(*dst, *src);
61 break;
62 case CSGType::Intersection:
63 MeshBoolean::cgal::intersect(*dst, *src);
64 break;
65 }
66}

References Slic3r::csg::Difference, Slic3r::MeshBoolean::cgal::intersect(), Slic3r::csg::Intersection, Slic3r::MeshBoolean::cgal::minus(), Slic3r::MeshBoolean::cgal::plus(), and Slic3r::csg::Union.

+ Here is the call graph for this function: