2019-11-11 10:41:14 +00:00
|
|
|
#ifndef SLA_HOLLOWING_HPP
|
|
|
|
#define SLA_HOLLOWING_HPP
|
2019-11-08 08:21:30 +00:00
|
|
|
|
2019-11-12 15:53:47 +00:00
|
|
|
#include <memory>
|
|
|
|
#include <libslic3r/SLA/Common.hpp>
|
2019-11-11 10:41:14 +00:00
|
|
|
#include <libslic3r/SLA/JobController.hpp>
|
2019-11-08 08:21:30 +00:00
|
|
|
|
|
|
|
namespace Slic3r {
|
2019-11-12 15:53:47 +00:00
|
|
|
|
|
|
|
class TriangleMesh;
|
|
|
|
|
2019-11-08 08:21:30 +00:00
|
|
|
namespace sla {
|
|
|
|
|
2019-11-11 10:41:14 +00:00
|
|
|
struct HollowingConfig
|
|
|
|
{
|
|
|
|
double min_thickness = 2.;
|
|
|
|
double quality = 0.5;
|
|
|
|
double closing_distance = 0.5;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct DrainHole
|
|
|
|
{
|
2019-11-13 14:57:38 +00:00
|
|
|
Vec3f pos;
|
|
|
|
Vec3f normal;
|
|
|
|
float radius;
|
|
|
|
float height;
|
|
|
|
|
2019-11-11 10:41:14 +00:00
|
|
|
DrainHole()
|
2019-11-13 14:57:38 +00:00
|
|
|
: pos(Vec3f::Zero()), normal(Vec3f::UnitZ()), radius(5.f), height(10.f)
|
2019-11-11 10:41:14 +00:00
|
|
|
{}
|
2019-11-13 14:57:38 +00:00
|
|
|
|
|
|
|
DrainHole(Vec3f p, Vec3f n, float r, float h)
|
|
|
|
: pos(p), normal(n), radius(r), height(h)
|
2019-11-11 10:41:14 +00:00
|
|
|
{}
|
|
|
|
|
2019-11-12 15:53:47 +00:00
|
|
|
bool operator==(const DrainHole &sp) const;
|
2019-11-11 10:41:14 +00:00
|
|
|
|
|
|
|
bool operator!=(const DrainHole &sp) const { return !(sp == (*this)); }
|
2019-11-15 14:48:52 +00:00
|
|
|
|
|
|
|
bool is_inside(const Vec3f& pt) const;
|
|
|
|
|
|
|
|
std::pair<float, float> get_intersections(const Vec3f& s,
|
|
|
|
const Vec3f& dir
|
|
|
|
) const;
|
2019-11-11 10:41:14 +00:00
|
|
|
|
2019-11-12 15:53:47 +00:00
|
|
|
template<class Archive> inline void serialize(Archive &ar)
|
2019-11-11 10:41:14 +00:00
|
|
|
{
|
2019-11-13 14:57:38 +00:00
|
|
|
ar(pos, normal, radius, height);
|
2019-11-11 10:41:14 +00:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2019-11-13 14:57:38 +00:00
|
|
|
using DrainHoles = std::vector<DrainHole>;
|
|
|
|
|
2019-11-12 15:53:47 +00:00
|
|
|
std::unique_ptr<TriangleMesh> generate_interior(const TriangleMesh &mesh,
|
|
|
|
const HollowingConfig & = {},
|
|
|
|
const JobController &ctl = {});
|
2019-11-08 08:21:30 +00:00
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif // HOLLOWINGFILTER_H
|