Optimized and improved rectilinear fill.

This commit is contained in:
bubnikv 2016-04-13 20:45:44 +02:00
parent 3b81bf0e33
commit f767ce816b
11 changed files with 62 additions and 6 deletions

View file

@ -6,6 +6,7 @@
#include "Fill3DHoneycomb.hpp"
#include "FillPlanePath.hpp"
#include "FillRectilinear.hpp"
#include "FillRectilinear2.hpp"
namespace Slic3r {
@ -18,7 +19,8 @@ Fill* Fill::new_from_type(const std::string &type)
if (type == "3dhoneycomb")
return new Fill3DHoneycomb();
if (type == "rectilinear")
return new FillRectilinear();
// return new FillRectilinear();
return new FillRectilinear2();
if (type == "line")
return new FillLine();
if (type == "grid")

View file

@ -12,6 +12,8 @@ class Surface;
struct FillParams
{
FillParams() { memset(this, 0, sizeof(FillParams)); }
coordf_t width;
// Fraction in <0, 1>
float density;

View file

@ -34,7 +34,7 @@ Polylines FillRectilinear::fill_surface(const Surface *surface, const FillParams
bounding_box.min.x - (bounding_box.min.x % this->_line_spacing),
bounding_box.min.y - (bounding_box.min.y % this->_line_spacing)));
}
// generate the basic pattern
coord_t x_max = bounding_box.max.x + SCALED_EPSILON;
Lines lines;