Welcome to mirror list, hosted at ThFree Co, Russian Federation.

Hollowing.hpp « SLA « libslic3r « src - github.com/supermerill/SuperSlicer.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 93a1f90fded23d0fe85869daca1705834179231a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#ifndef SLA_HOLLOWING_HPP
#define SLA_HOLLOWING_HPP

#include <libslic3r/OpenVDBUtils.hpp>
#include <libslic3r/SLA/JobController.hpp>

namespace Slic3r {
namespace sla {

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);
    }
};

TriangleMesh generate_interior(const TriangleMesh &mesh,
                               const HollowingConfig & = {},
                               const JobController &ctl = {});

}
}

#endif // HOLLOWINGFILTER_H