Ported LayerRegion::make_slices() to XS

This commit is contained in:
Alessandro Ranellucci 2014-11-09 16:23:50 +01:00
parent 948793e570
commit b69caff93c
11 changed files with 78 additions and 77 deletions

View file

@ -1,5 +1,7 @@
#include "Layer.hpp"
#include "ClipperUtils.hpp"
#include "Print.hpp"
#include "Surface.hpp"
namespace Slic3r {
@ -38,6 +40,18 @@ LayerRegion::flow(FlowRole role, bool bridge, double width) const
);
}
void
LayerRegion::merge_slices()
{
ExPolygons expp;
union_(this->slices, expp);
this->slices.surfaces.clear();
this->slices.surfaces.reserve(expp.size());
for (ExPolygons::const_iterator expoly = expp.begin(); expoly != expp.end(); ++expoly)
this->slices.surfaces.push_back(Surface(stInternal, *expoly));
}
#ifdef SLIC3RXS
REGISTER_CLASS(LayerRegion, "Layer::Region");
#endif