2014-08-03 19:42:29 +02:00
|
|
|
#ifndef _libslic3r_h_
|
|
|
|
#define _libslic3r_h_
|
|
|
|
|
|
|
|
// this needs to be included early for MSVC (listing it in Build.PL is not enough)
|
|
|
|
#include <ostream>
|
|
|
|
#include <iostream>
|
|
|
|
#include <sstream>
|
2016-09-26 12:42:44 +02:00
|
|
|
#include <stdint.h>
|
2014-08-03 19:42:29 +02:00
|
|
|
|
2015-12-06 11:18:27 +01:00
|
|
|
#define SLIC3R_VERSION "1.3.0-dev"
|
2014-11-09 20:41:27 +01:00
|
|
|
|
2016-09-13 13:30:00 +02:00
|
|
|
//FIXME This epsilon value is used for many non-related purposes:
|
|
|
|
// For a threshold of a squared Euclidean distance,
|
|
|
|
// for a trheshold in a difference of radians,
|
|
|
|
// for a threshold of a cross product of two non-normalized vectors etc.
|
2014-08-03 19:42:29 +02:00
|
|
|
#define EPSILON 1e-4
|
2016-09-13 13:30:00 +02:00
|
|
|
// Scaling factor for a conversion from coord_t to coordf_t: 10e-6
|
|
|
|
// This scaling generates a following fixed point representation with for a 32bit integer:
|
|
|
|
// 0..4294mm with 1nm resolution
|
2014-08-03 19:42:29 +02:00
|
|
|
#define SCALING_FACTOR 0.000001
|
2016-09-13 13:30:00 +02:00
|
|
|
// RESOLUTION, SCALED_RESOLUTION: Used as an error threshold for a Douglas-Peucker polyline simplification algorithm.
|
2015-07-02 18:57:40 +02:00
|
|
|
#define RESOLUTION 0.0125
|
|
|
|
#define SCALED_RESOLUTION (RESOLUTION / SCALING_FACTOR)
|
2014-08-03 19:42:29 +02:00
|
|
|
#define PI 3.141592653589793238
|
2016-09-13 13:30:00 +02:00
|
|
|
// When extruding a closed loop, the loop is interrupted and shortened a bit to reduce the seam.
|
2015-07-02 20:24:16 +02:00
|
|
|
#define LOOP_CLIPPING_LENGTH_OVER_NOZZLE_DIAMETER 0.15
|
2016-09-13 13:30:00 +02:00
|
|
|
// Maximum perimeter length for the loop to apply the small perimeter speed.
|
2015-07-02 20:24:16 +02:00
|
|
|
#define SMALL_PERIMETER_LENGTH (6.5 / SCALING_FACTOR) * 2 * PI
|
2015-07-03 22:58:29 +02:00
|
|
|
#define INSET_OVERLAP_TOLERANCE 0.4
|
2016-09-26 12:42:44 +02:00
|
|
|
// 3mm ring around the top / bottom / bridging areas.
|
|
|
|
//FIXME This is quite a lot.
|
|
|
|
#define EXTERNAL_INFILL_MARGIN 3.
|
2015-12-19 14:49:29 +01:00
|
|
|
#define scale_(val) ((val) / SCALING_FACTOR)
|
|
|
|
#define unscale(val) ((val) * SCALING_FACTOR)
|
2014-08-03 19:42:29 +02:00
|
|
|
#define SCALED_EPSILON scale_(EPSILON)
|
|
|
|
typedef long coord_t;
|
|
|
|
typedef double coordf_t;
|
|
|
|
|
2015-04-16 21:22:04 +02:00
|
|
|
namespace Slic3r {
|
|
|
|
|
2016-08-21 21:46:17 +02:00
|
|
|
enum Axis { X=0, Y, Z };
|
2015-04-16 21:22:04 +02:00
|
|
|
|
|
|
|
}
|
2014-08-03 19:42:29 +02:00
|
|
|
using namespace Slic3r;
|
|
|
|
|
|
|
|
/* Implementation of CONFESS("foo"): */
|
2016-08-21 21:46:17 +02:00
|
|
|
#ifdef _MSC_VER
|
|
|
|
#define CONFESS(...) confess_at(__FILE__, __LINE__, __FUNCTION__, __VA_ARGS__)
|
|
|
|
#else
|
|
|
|
#define CONFESS(...) confess_at(__FILE__, __LINE__, __func__, __VA_ARGS__)
|
|
|
|
#endif
|
2014-08-03 19:42:29 +02:00
|
|
|
void confess_at(const char *file, int line, const char *func, const char *pat, ...);
|
|
|
|
/* End implementation of CONFESS("foo"): */
|
|
|
|
|
2016-04-10 19:07:34 +02:00
|
|
|
// Which C++ version is supported?
|
|
|
|
// For example, could optimized functions with move semantics be used?
|
|
|
|
#if __cplusplus==201402L
|
|
|
|
#define SLIC3R_CPPVER 14
|
|
|
|
#elif __cplusplus==201103L
|
|
|
|
#define SLIC3R_CPPVER 11
|
|
|
|
#else
|
|
|
|
#define SLIC3R_CPPVER 0
|
|
|
|
#endif
|
|
|
|
|
2014-08-03 19:42:29 +02:00
|
|
|
#endif
|