mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-14 18:27:58 -06:00
Initial implementation of MeshClipper class
So far the work is shared between the old code in GLGizmoSlaSupports.cpp and the new class
This commit is contained in:
parent
cf23146ee3
commit
546917830b
5 changed files with 149 additions and 29 deletions
37
src/slic3r/GUI/MeshClipper.hpp
Normal file
37
src/slic3r/GUI/MeshClipper.hpp
Normal file
|
@ -0,0 +1,37 @@
|
|||
#ifndef slic3r_MeshClipper_hpp_
|
||||
#define slic3r_MeshClipper_hpp_
|
||||
|
||||
#include "libslic3r/Point.hpp"
|
||||
#include "slic3r/GUI/GLCanvas3D.hpp"
|
||||
|
||||
namespace Slic3r {
|
||||
namespace GUI {
|
||||
|
||||
class MeshClipper {
|
||||
public:
|
||||
void set_plane(const ClippingPlane& plane);
|
||||
void set_mesh(const TriangleMesh& mesh);
|
||||
void set_transformation(const Geometry::Transformation& trafo);
|
||||
|
||||
const std::vector<Vec2f>& get_triangles();
|
||||
|
||||
private:
|
||||
void recalculate_triangles();
|
||||
std::pair<Vec3f, float> get_mesh_cut_normal() const;
|
||||
|
||||
|
||||
Geometry::Transformation m_trafo;
|
||||
const TriangleMesh* m_mesh = nullptr;
|
||||
ClippingPlane m_plane;
|
||||
std::vector<Vec2f> m_triangles;
|
||||
bool m_triangles_valid = false;
|
||||
std::unique_ptr<TriangleMeshSlicer> m_tms;
|
||||
};
|
||||
|
||||
|
||||
|
||||
} // namespace GUI
|
||||
} // namespace Slic3r
|
||||
|
||||
|
||||
#endif // slic3r_MeshClipper_hpp_
|
Loading…
Add table
Add a link
Reference in a new issue