mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-11 16:57:53 -06:00
Merge remote-tracking branch 'origin/dev2' into dev_native
This commit is contained in:
commit
6260e43f61
30 changed files with 785 additions and 443 deletions
|
@ -74,6 +74,20 @@ inline std::string header_slic3r_generated() { return std::string("generated by
|
|||
// getpid platform wrapper
|
||||
extern unsigned get_current_pid();
|
||||
|
||||
template <typename Real>
|
||||
Real round_nearest(Real value, unsigned int decimals)
|
||||
{
|
||||
Real res = (Real)0;
|
||||
if (decimals == 0)
|
||||
res = ::round(value);
|
||||
else
|
||||
{
|
||||
Real power = ::pow((Real)10, (int)decimals);
|
||||
res = ::round(value * power + (Real)0.5) / power;
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
// Compute the next highest power of 2 of 32-bit v
|
||||
// http://graphics.stanford.edu/~seander/bithacks.html
|
||||
inline uint16_t next_highest_power_of_2(uint16_t v)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue