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

Classes

class  ClipperZIntersectionVisitor
 

Typedefs

using ZPoint = ClipperLib_Z::IntPoint
 
using ZPoints = ClipperLib_Z::Path
 
using ZPath = ClipperLib_Z::Path
 
using ZPaths = ClipperLib_Z::Paths
 

Functions

bool zpoint_lower (const ZPoint &l, const ZPoint &r)
 
template<bool Open = false>
ZPath to_zpath (const Points &path, coord_t z)
 
template<bool Open = false>
ZPaths to_zpaths (const VecOfPoints &paths, coord_t z)
 
template<bool Open = false>
ZPaths expolygons_to_zpaths (const ExPolygons &src, coord_t &base_idx)
 
template<bool Open = false>
Points from_zpath (const ZPoints &path)
 
template<bool Open = false>
void from_zpaths (const ZPaths &paths, VecOfPoints &out)
 
template<bool Open = false>
VecOfPoints from_zpaths (const ZPaths &paths)
 

Typedef Documentation

◆ ZPath

using Slic3r::ClipperZUtils::ZPath = typedef ClipperLib_Z::Path

◆ ZPaths

using Slic3r::ClipperZUtils::ZPaths = typedef ClipperLib_Z::Paths

◆ ZPoint

using Slic3r::ClipperZUtils::ZPoint = typedef ClipperLib_Z::IntPoint

◆ ZPoints

using Slic3r::ClipperZUtils::ZPoints = typedef ClipperLib_Z::Path

Function Documentation

◆ expolygons_to_zpaths()

template<bool Open = false>
ZPaths Slic3r::ClipperZUtils::expolygons_to_zpaths ( const ExPolygons src,
coord_t base_idx 
)
inline
57{
58 ZPaths out;
59 out.reserve(std::accumulate(src.begin(), src.end(), size_t(0),
60 [](const size_t acc, const ExPolygon &expoly) { return acc + expoly.num_contours(); }));
61 for (const ExPolygon &expoly : src) {
62 out.emplace_back(to_zpath<Open>(expoly.contour.points, base_idx));
63 for (const Polygon &hole : expoly.holes)
64 out.emplace_back(to_zpath<Open>(hole.points, base_idx));
65 ++ base_idx;
66 }
67 return out;
68}
Definition ExPolygon.hpp:16
Polygon contour
Definition ExPolygon.hpp:35
Points points
Definition MultiPoint.hpp:18
Definition Polygon.hpp:24
ClipperLib_Z::Paths ZPaths
Definition ClipperZUtils.hpp:17
ZPath to_zpath(const Points &path, coord_t z)
Definition ClipperZUtils.hpp:27

References Slic3r::ExPolygon::contour, Slic3r::ExPolygon::holes, and Slic3r::MultiPoint::points.

Referenced by Slic3r::Algorithm::wave_seeds().

+ Here is the caller graph for this function:

◆ from_zpath()

template<bool Open = false>
Points Slic3r::ClipperZUtils::from_zpath ( const ZPoints path)
inline
74{
75 Points out;
76 if (! path.empty()) {
77 out.reserve((path.size() + Open) ? 1 : 0);
78 for (const ZPoint &p : path)
79 out.emplace_back(p.x(), p.y());
80 if (Open)
81 out.emplace_back(out.front());
82 }
83 return out;
84}
ClipperLib_Z::IntPoint ZPoint
Definition ClipperZUtils.hpp:14
std::vector< Point, PointsAllocator< Point > > Points
Definition Point.hpp:58

Referenced by Slic3r::expolygons_to_zpaths_shrunk(), and Slic3r::Algorithm::wave_seeds().

+ Here is the caller graph for this function:

◆ from_zpaths() [1/2]

template<bool Open = false>
VecOfPoints Slic3r::ClipperZUtils::from_zpaths ( const ZPaths paths)
inline
97{
98 VecOfPoints out;
99 from_zpaths(paths, out);
100 return out;
101}
void from_zpaths(const ZPaths &paths, VecOfPoints &out)
Definition ClipperZUtils.hpp:89
std::vector< Points, PointsAllocator< Points > > VecOfPoints
Definition Point.hpp:66

References from_zpaths().

+ Here is the call graph for this function:

◆ from_zpaths() [2/2]

template<bool Open = false>
void Slic3r::ClipperZUtils::from_zpaths ( const ZPaths paths,
VecOfPoints out 
)
inline
90{
91 out.reserve(out.size() + paths.size());
92 for (const ZPoints &path : paths)
93 out.emplace_back(from_zpath<Open>(path));
94}
ClipperLib_Z::Path ZPoints
Definition ClipperZUtils.hpp:15
Points from_zpath(const ZPoints &path)
Definition ClipperZUtils.hpp:73

Referenced by from_zpaths().

+ Here is the caller graph for this function:

◆ to_zpath()

template<bool Open = false>
ZPath Slic3r::ClipperZUtils::to_zpath ( const Points path,
coord_t  z 
)
inline
28{
29 ZPath out;
30 if (! path.empty()) {
31 out.reserve((path.size() + Open) ? 1 : 0);
32 for (const Point &p : path)
33 out.emplace_back(p.x(), p.y(), z);
34 if (Open)
35 out.emplace_back(out.front());
36 }
37 return out;
38}
Definition Point.hpp:158
ClipperLib_Z::Path ZPath
Definition ClipperZUtils.hpp:16

◆ to_zpaths()

template<bool Open = false>
ZPaths Slic3r::ClipperZUtils::to_zpaths ( const VecOfPoints paths,
coord_t  z 
)
inline
44{
45 ZPaths out;
46 out.reserve(paths.size());
47 for (const Points &path : paths)
48 out.emplace_back(to_zpath<Open>(path, z));
49 return out;
50}

◆ zpoint_lower()

bool Slic3r::ClipperZUtils::zpoint_lower ( const ZPoint l,
const ZPoint r 
)
inline
20{
21 return l.x() < r.x() || (l.x() == r.x() && (l.y() < r.y() || (l.y() == r.y() && l.z() < r.z())));
22}