2019-11-11 10:41:14 +00:00
|
|
|
#ifndef SLA_HOLLOWING_HPP
|
|
|
|
#define SLA_HOLLOWING_HPP
|
2019-11-08 08:21:30 +00:00
|
|
|
|
|
|
|
#include <libslic3r/OpenVDBUtils.hpp>
|
2019-11-11 10:41:14 +00:00
|
|
|
#include <libslic3r/SLA/JobController.hpp>
|
2019-11-08 08:21:30 +00:00
|
|
|
|
|
|
|
namespace Slic3r {
|
|
|
|
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
|
|
|
|
{
|
|
|
|
Vec3f m_pos;
|
|
|
|
Vec3f m_normal;
|
|
|
|
float m_radius;
|
|
|
|
float m_height;
|
|
|
|
|
|
|
|
DrainHole()
|
|
|
|
: m_pos(Vec3f::Zero()), m_normal(Vec3f::UnitZ()), m_radius(5.f),
|
|
|
|
m_height(10.f)
|
|
|
|
{}
|
|
|
|
|
|
|
|
DrainHole(Vec3f position, Vec3f normal, float radius, float height)
|
|
|
|
: m_pos(position)
|
|
|
|
, m_normal(normal)
|
|
|
|
, m_radius(radius)
|
|
|
|
, m_height(height)
|
|
|
|
{}
|
|
|
|
|
|
|
|
bool operator==(const DrainHole &sp) const
|
|
|
|
{
|
|
|
|
return (m_pos == sp.m_pos) && (m_normal == sp.m_normal) &&
|
|
|
|
is_approx(m_radius, sp.m_radius) &&
|
|
|
|
is_approx(m_height, sp.m_height);
|
|
|
|
}
|
|
|
|
|
|
|
|
bool operator!=(const DrainHole &sp) const { return !(sp == (*this)); }
|
|
|
|
|
|
|
|
template<class Archive> void serialize(Archive &ar)
|
|
|
|
{
|
|
|
|
ar(m_pos, m_normal, m_radius, m_height);
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2019-11-08 08:21:30 +00:00
|
|
|
TriangleMesh generate_interior(const TriangleMesh &mesh,
|
2019-11-11 10:41:14 +00:00
|
|
|
const HollowingConfig & = {},
|
|
|
|
const JobController &ctl = {});
|
2019-11-08 08:21:30 +00:00
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif // HOLLOWINGFILTER_H
|