#ifndef SLIC3R_TEST_UTILS #define SLIC3R_TEST_UTILS #include #include #include #if defined(WIN32) || defined(_WIN32) #define PATH_SEPARATOR R"(\)" #else #define PATH_SEPARATOR R"(/)" #endif inline Slic3r::TriangleMesh load_model(const std::string &obj_filename) { Slic3r::TriangleMesh mesh; auto fpath = TEST_DATA_DIR PATH_SEPARATOR + obj_filename; Slic3r::load_obj(fpath.c_str(), &mesh); return mesh; } inline std::string get_model_path(const std::string &obj_filename) { std::string fpath = TEST_DATA_DIR PATH_SEPARATOR + obj_filename; return fpath; } template Slic3r::FloatingOnly random_value(T minv, T maxv) { static std::mt19937 rng(std::random_device{}()); std::uniform_real_distribution dist(minv, maxv); return dist(rng); } template Slic3r::IntegerOnly random_value(T minv, T maxv) { static std::mt19937 rng(std::random_device{}()); std::uniform_int_distribution dist(minv, maxv); return dist(rng); } #endif // SLIC3R_TEST_UTILS