Ported make_perimeters() to C++

This commit is contained in:
Alessandro Ranellucci 2015-07-23 16:27:21 +02:00
parent 15d2522f3d
commit 6ac79e3ed6
7 changed files with 43 additions and 34 deletions

View file

@ -1,5 +1,6 @@
#include "Layer.hpp"
#include "ClipperUtils.hpp"
#include "PerimeterGenerator.hpp"
#include "Print.hpp"
#include "Surface.hpp"
@ -53,6 +54,38 @@ LayerRegion::merge_slices()
this->slices.surfaces.push_back(Surface(stInternal, *expoly));
}
void
LayerRegion::make_perimeters(const SurfaceCollection &slices, SurfaceCollection* fill_surfaces)
{
this->perimeters.clear();
this->thin_fills.clear();
PerimeterGenerator g(
// input:
&slices,
this->layer()->height,
this->flow(frPerimeter),
&this->region()->config,
&this->layer()->object()->config,
&this->layer()->object()->print()->config,
// output:
&this->perimeters,
&this->thin_fills,
fill_surfaces
);
if (this->layer()->lower_layer != NULL)
g.lower_slices = &this->layer()->lower_layer->slices;
g.layer_id = this->layer()->id();
g.ext_perimeter_flow = this->flow(frExternalPerimeter);
g.overhang_flow = this->region()->flow(frPerimeter, -1, true, false, -1, *this->layer()->object());
g.solid_infill_flow = this->flow(frSolidInfill);
g.process();
}
void
LayerRegion::prepare_fill_surfaces()
{