2019-11-11 10:41:14 +00:00
|
|
|
#ifndef SLA_ROTFINDER_HPP
|
|
|
|
#define SLA_ROTFINDER_HPP
|
2018-11-02 10:57:57 +00:00
|
|
|
|
|
|
|
#include <functional>
|
|
|
|
#include <array>
|
|
|
|
|
2020-09-04 15:51:22 +00:00
|
|
|
#include <libslic3r/Point.hpp>
|
|
|
|
|
2018-11-02 10:57:57 +00:00
|
|
|
namespace Slic3r {
|
|
|
|
|
2020-09-04 15:51:22 +00:00
|
|
|
class SLAPrintObject;
|
2018-11-02 10:57:57 +00:00
|
|
|
|
|
|
|
namespace sla {
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The function should find the best rotation for SLA upside down printing.
|
|
|
|
*
|
|
|
|
* @param modelobj The model object representing the 3d mesh.
|
|
|
|
* @param accuracy The optimization accuracy from 0.0f to 1.0f. Currently,
|
|
|
|
* the nlopt genetic optimizer is used and the number of iterations is
|
|
|
|
* accuracy * 100000. This can change in the future.
|
|
|
|
* @param statuscb A status indicator callback called with the unsigned
|
|
|
|
* argument spanning from 0 to 100. May not reach 100 if the optimization finds
|
|
|
|
* an optimum before max iterations are reached.
|
|
|
|
* @param stopcond A function that if returns true, the search process will be
|
|
|
|
* terminated and the best solution found will be returned.
|
|
|
|
*
|
|
|
|
* @return Returns the rotations around each axis (x, y, z)
|
|
|
|
*/
|
2020-08-26 08:25:09 +00:00
|
|
|
std::array<double, 2> find_best_rotation(
|
2020-09-04 15:51:22 +00:00
|
|
|
const SLAPrintObject& modelobj,
|
2018-11-22 15:04:21 +00:00
|
|
|
float accuracy = 1.0f,
|
2018-11-02 10:57:57 +00:00
|
|
|
std::function<void(unsigned)> statuscb = [] (unsigned) {},
|
|
|
|
std::function<bool()> stopcond = [] () { return false; }
|
|
|
|
);
|
|
|
|
|
2020-09-04 15:51:22 +00:00
|
|
|
double get_model_supportedness(const SLAPrintObject &mesh,
|
|
|
|
const Transform3d & tr);
|
|
|
|
|
|
|
|
} // namespace sla
|
|
|
|
} // namespace Slic3r
|
2018-11-02 10:57:57 +00:00
|
|
|
|
|
|
|
#endif // SLAROTFINDER_HPP
|