mirror of
https://github.com/QIDITECH/QIDISlicer.git
synced 2026-01-30 23:48:44 +03:00
Merge prusa 2.6.1
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
|
||||
#include <libslic3r/TriangleMesh.hpp>
|
||||
#include <libslic3r/Format/OBJ.hpp>
|
||||
#include <random>
|
||||
|
||||
#if defined(WIN32) || defined(_WIN32)
|
||||
#define PATH_SEPARATOR R"(\)"
|
||||
@@ -18,4 +19,22 @@ inline Slic3r::TriangleMesh load_model(const std::string &obj_filename)
|
||||
return mesh;
|
||||
}
|
||||
|
||||
template<class T>
|
||||
Slic3r::FloatingOnly<T> random_value(T minv, T maxv)
|
||||
{
|
||||
static std::mt19937 rng(std::random_device{}());
|
||||
std::uniform_real_distribution<T> dist(minv, maxv);
|
||||
|
||||
return dist(rng);
|
||||
}
|
||||
|
||||
template<class T>
|
||||
Slic3r::IntegerOnly<T> random_value(T minv, T maxv)
|
||||
{
|
||||
static std::mt19937 rng(std::random_device{}());
|
||||
std::uniform_int_distribution<T> dist(minv, maxv);
|
||||
|
||||
return dist(rng);
|
||||
}
|
||||
|
||||
#endif // SLIC3R_TEST_UTILS
|
||||
|
||||
Reference in New Issue
Block a user