GCodeProcessor -> Extract toolpaths height from gcode moves

This commit is contained in:
enricoturri1966 2020-08-13 12:51:50 +02:00
parent 7be5860908
commit b80bde11f3
5 changed files with 64 additions and 46 deletions

View file

@ -110,19 +110,20 @@ std::string header_slic3r_generated();
// getpid platform wrapper
extern unsigned get_current_pid();
#if !ENABLE_GCODE_VIEWER
template <typename Real>
Real round_nearest(Real value, unsigned int decimals)
{
Real res = (Real)0;
if (decimals == 0)
res = ::round(value);
else
{
else {
Real power = ::pow((Real)10, (int)decimals);
res = ::round(value * power + (Real)0.5) / power;
}
return res;
}
#endif // !ENABLE_GCODE_VIEWER
// Compute the next highest power of 2 of 32-bit v
// http://graphics.stanford.edu/~seander/bithacks.html