mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-25 15:44:12 -06:00
Ported Surface->offset() to XS
This commit is contained in:
parent
a331f4d27a
commit
46e3b3180e
6 changed files with 35 additions and 5 deletions
|
@ -164,6 +164,24 @@ offset(const Slic3r::Polylines &polylines, Slic3r::Polygons &retval, const float
|
|||
delete output;
|
||||
}
|
||||
|
||||
void
|
||||
offset(const Slic3r::Surface &surface, Slic3r::Surfaces &retval, const float delta,
|
||||
double scale, ClipperLib::JoinType joinType, double miterLimit)
|
||||
{
|
||||
// perform offset
|
||||
Slic3r::ExPolygons expp;
|
||||
offset_ex(surface.expolygon, expp, delta, scale, joinType, miterLimit);
|
||||
|
||||
// clone the input surface for each expolygon we got
|
||||
retval.clear();
|
||||
retval.reserve(expp.size());
|
||||
for (ExPolygons::iterator it = expp.begin(); it != expp.end(); ++it) {
|
||||
Surface s = surface; // clone
|
||||
s.expolygon = *it;
|
||||
retval.push_back(s);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
offset_ex(const Slic3r::Polygons &polygons, Slic3r::ExPolygons &retval, const float delta,
|
||||
double scale, ClipperLib::JoinType joinType, double miterLimit)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue