2018-12-07 13:10:16 +00:00
|
|
|
#ifndef SLAAUTOSUPPORTS_HPP_
|
|
|
|
#define SLAAUTOSUPPORTS_HPP_
|
|
|
|
|
|
|
|
#include <libslic3r/Point.hpp>
|
2018-12-07 14:24:50 +00:00
|
|
|
#include <libslic3r/TriangleMesh.hpp>
|
2018-12-07 13:10:16 +00:00
|
|
|
|
2018-12-07 13:10:16 +00:00
|
|
|
|
|
|
|
|
|
|
|
namespace Slic3r {
|
|
|
|
|
|
|
|
class ModelObject;
|
|
|
|
|
2018-12-14 15:15:59 +00:00
|
|
|
namespace SLAAutoSupports {
|
2018-12-07 13:10:16 +00:00
|
|
|
|
|
|
|
|
|
|
|
class SLAAutoSupports {
|
|
|
|
public:
|
|
|
|
struct Config {
|
|
|
|
float density_at_horizontal;
|
|
|
|
float density_at_45;
|
|
|
|
float minimal_z;
|
|
|
|
};
|
|
|
|
|
|
|
|
SLAAutoSupports(ModelObject& mo, const SLAAutoSupports::Config& c);
|
|
|
|
void generate();
|
|
|
|
|
|
|
|
private:
|
|
|
|
TriangleMesh mesh;
|
|
|
|
static float angle_from_normal(const stl_normal& normal) { return acos((-normal.normalized())(2)); }
|
|
|
|
float get_required_density(float angle) const;
|
|
|
|
static float approximate_geodesic_distance(const Vec3f& p1, const Vec3f& p2, Vec3f& n1, Vec3f& n2);
|
|
|
|
|
|
|
|
ModelObject& m_model_object;
|
|
|
|
SLAAutoSupports::Config m_config;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2018-12-14 15:15:59 +00:00
|
|
|
std::vector<Vec3d> find_islands(const std::vector<ExPolygons>& slices, const std::vector<float>& heights);
|
2018-12-07 13:10:16 +00:00
|
|
|
|
2018-12-14 15:15:59 +00:00
|
|
|
} // namespace SLAAutoSupports
|
2018-12-07 13:10:16 +00:00
|
|
|
|
|
|
|
} // namespace Slic3r
|
|
|
|
|
|
|
|
|
|
|
|
#endif // SLAAUTOSUPPORTS_HPP_
|