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;

View file

@ -13,7 +13,7 @@
#include <assert.h>
#ifdef SLIC3R_DEBUG
#define SLIC3R_TRIANGLEMESH_DEBUG
// #define SLIC3R_TRIANGLEMESH_DEBUG
#include "SVG.hpp"
#endif

View file

@ -36,4 +36,19 @@ enable_screensaver()
#endif
}
bool
debugged()
{
return IsDebuggerPresent();
}
void
break_to_debugger()
{
#ifdef _WIN32
if (IsDebuggerPresent())
DebugBreak();
#endif /* _WIN32 */
}
} }

View file

@ -5,6 +5,8 @@ namespace Slic3r { namespace GUI {
void disable_screensaver();
void enable_screensaver();
bool debugged();
void break_to_debugger();
} }