diff options
author | remi durand <remi-j.durand@thalesgroup.com> | 2022-01-12 10:49:19 +0300 |
---|---|---|
committer | remi durand <remi-j.durand@thalesgroup.com> | 2022-01-12 10:49:19 +0300 |
commit | 6e0017ff8fc82ce66e65bcddd2285d48c1b6fb1c (patch) | |
tree | 07fa4bca6aa5dfb8fb3dcdeb8c5d691e443247dc /src/libslic3r/SLA/IndexedMesh.hpp | |
parent | 42db5ca0d12e9a54b8c378dbf8ec12671566a9ec (diff) | |
parent | 215e845c31889f92f78e8be1d9ee52f6209a8082 (diff) |
Merge remote-tracking branch 'remotes/prusa/master' 2.4 into dev 2.3.58
still need much tests (& bugfixes) and finish some merging things.
Diffstat (limited to 'src/libslic3r/SLA/IndexedMesh.hpp')
-rw-r--r-- | src/libslic3r/SLA/IndexedMesh.hpp | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/src/libslic3r/SLA/IndexedMesh.hpp b/src/libslic3r/SLA/IndexedMesh.hpp index 3e27ffe0c..bb2dee034 100644 --- a/src/libslic3r/SLA/IndexedMesh.hpp +++ b/src/libslic3r/SLA/IndexedMesh.hpp @@ -15,6 +15,8 @@ #include "libslic3r/SLA/Hollowing.hpp" #endif +struct indexed_triangle_set; + namespace Slic3r { class TriangleMesh; @@ -29,7 +31,7 @@ using PointSet = Eigen::MatrixXd; class IndexedMesh { class AABBImpl; - const TriangleMesh* m_tm; + const indexed_triangle_set* m_tm; double m_ground_level = 0, m_gnd_offset = 0; std::unique_ptr<AABBImpl> m_aabb; @@ -40,9 +42,14 @@ class IndexedMesh { std::vector<DrainHole> m_holes; #endif + template<class M> void init(const M &mesh, bool calculate_epsilon); + public: - explicit IndexedMesh(const TriangleMesh&); + // calculate_epsilon ... calculate epsilon for triangle-ray intersection from an average triangle edge length. + // If set to false, a default epsilon is used, which works for "reasonable" meshes. + explicit IndexedMesh(const indexed_triangle_set &tmesh, bool calculate_epsilon = false); + explicit IndexedMesh(const TriangleMesh &mesh, bool calculate_epsilon = false); IndexedMesh(const IndexedMesh& other); IndexedMesh& operator=(const IndexedMesh&); @@ -130,7 +137,7 @@ public: Vec3d normal_by_face_id(int face_id) const; - const TriangleMesh * get_triangle_mesh() const { return m_tm; } + const indexed_triangle_set * get_triangle_mesh() const { return m_tm; } }; // Calculate the normals for the selected points (from 'points' set) on the |