GCode Preview - Code cleanup

This commit is contained in:
Enrico Turri 2018-01-17 10:39:05 +01:00
parent c63e6b74fa
commit a417cf955d
24 changed files with 12 additions and 987 deletions

View file

@ -163,29 +163,12 @@ static inline T clamp(const T low, const T high, const T value)
return std::max(low, std::min(high, value));
}
//############################################################################################################
#define ENRICO_GCODE_PREVIEW 1
//############################################################################################################
//############################################################################################################
#if ENRICO_GCODE_PREVIEW
template <typename T, typename Number>
static inline T lerp(const T& a, const T& b, Number t)
{
assert((t >= Number(-EPSILON)) && (t <= Number(1) + Number(EPSILON)));
return (Number(1) - t) * a + t * b;
}
#else
//############################################################################################################
template <typename T>
static inline T lerp(const T a, const T b, const T t)
{
assert(t >= T(-EPSILON) && t <= T(1.+EPSILON));
return (1. - t) * a + t * b;
}
//############################################################################################################
#endif // ENRICO_GCODE_PREVIEW
//############################################################################################################
} // namespace Slic3r