mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-12 01:07:57 -06:00
Ported traverse_pt() to XS
This commit is contained in:
parent
b47b8ee34f
commit
a93c862338
9 changed files with 71 additions and 27 deletions
|
@ -1,4 +1,5 @@
|
|||
#include "Geometry.hpp"
|
||||
#include "clipper.hpp"
|
||||
#include <algorithm>
|
||||
#include <map>
|
||||
|
||||
|
@ -80,4 +81,16 @@ chained_path(Points &points, std::vector<Points::size_type> &retval)
|
|||
chained_path(points, retval, points.front());
|
||||
}
|
||||
|
||||
/* retval and items must be different containers */
|
||||
template<class T>
|
||||
void
|
||||
chained_path_items(Points &points, T &items, T &retval)
|
||||
{
|
||||
std::vector<Points::size_type> indices;
|
||||
chained_path(points, indices);
|
||||
for (std::vector<Points::size_type>::const_iterator it = indices.begin(); it != indices.end(); ++it)
|
||||
retval.push_back(items[*it]);
|
||||
}
|
||||
template void chained_path_items(Points &points, ClipperLib::PolyNodes &items, ClipperLib::PolyNodes &retval);
|
||||
|
||||
} }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue