#include </home/runner/work/OrcaSlicer/OrcaSlicer/src/slic3r/GUI/MeshUtils.hpp>
Public Member Functions | |
| MeshRaycaster (std::shared_ptr< const TriangleMesh > mesh) | |
| MeshRaycaster (const TriangleMesh &mesh) | |
| bool | unproject_on_mesh (const Vec2d &mouse_pos, const Transform3d &trafo, const Camera &camera, Vec3f &position, Vec3f &normal, const ClippingPlane *clipping_plane=nullptr, size_t *facet_idx=nullptr, bool sinking_limit=true) const |
| const AABBMesh & | get_aabb_mesh () const |
| bool | intersects_line (Vec3d point, Vec3d direction, const Transform3d &trafo) const |
| std::vector< unsigned > | get_unobscured_idxs (const Geometry::Transformation &trafo, const Camera &camera, const std::vector< Vec3f > &points, const ClippingPlane *clipping_plane=nullptr) const |
| bool | closest_hit (const Vec2d &mouse_pos, const Transform3d &trafo, const Camera &camera, Vec3f &position, Vec3f &normal, const ClippingPlane *clipping_plane=nullptr, size_t *facet_idx=nullptr) const |
| Vec3f | get_closest_point (const Vec3f &point, Vec3f *normal=nullptr) const |
| int | get_closest_facet (const Vec3f &point) const |
| Vec3f | get_triangle_normal (size_t facet_idx) const |
Static Public Member Functions | |
| static void | line_from_mouse_pos (const Vec2d &mouse_pos, const Transform3d &trafo, const Camera &camera, Vec3d &point, Vec3d &direction) |
Private Attributes | |
| std::shared_ptr< const TriangleMesh > | m_mesh |
| AABBMesh | m_emesh |
| std::vector< stl_normal > | m_normals |
|
inlineexplicit |
References Slic3r::its_face_normals(), m_emesh, m_mesh, and m_normals.
Referenced by MeshRaycaster().
|
inlineexplicit |
References MeshRaycaster(), and Slic3r::make_unique().
| bool Slic3r::GUI::MeshRaycaster::closest_hit | ( | const Vec2d & | mouse_pos, |
| const Transform3d & | trafo, | ||
| const Camera & | camera, | ||
| Vec3f & | position, | ||
| Vec3f & | normal, | ||
| const ClippingPlane * | clipping_plane = nullptr, | ||
| size_t * | facet_idx = nullptr ) const |
References Slic3r::AABBMesh::hit_result::face(), Slic3r::GUI::ClippingPlane::is_point_clipped(), line_from_mouse_pos(), m_emesh, Slic3r::AABBMesh::hit_result::normal(), Slic3r::normal(), and Slic3r::AABBMesh::hit_result::position().
|
inline |
| int Slic3r::GUI::MeshRaycaster::get_closest_facet | ( | const Vec3f & | point | ) | const |
| Vec3f Slic3r::GUI::MeshRaycaster::get_closest_point | ( | const Vec3f & | point, |
| Vec3f * | normal = nullptr ) const |
References m_emesh, m_normals, and Slic3r::normal().
| Vec3f Slic3r::GUI::MeshRaycaster::get_triangle_normal | ( | size_t | facet_idx | ) | const |
| std::vector< unsigned > Slic3r::GUI::MeshRaycaster::get_unobscured_idxs | ( | const Geometry::Transformation & | trafo, |
| const Camera & | camera, | ||
| const std::vector< Vec3f > & | points, | ||
| const ClippingPlane * | clipping_plane = nullptr ) const |
References EPSILON, Slic3r::GUI::Camera::get_dir_forward(), Slic3r::Geometry::Transformation::get_matrix(), Slic3r::Geometry::Transformation::get_rotation_matrix(), Slic3r::Geometry::Transformation::get_scaling_factor(), Slic3r::GUI::ClippingPlane::is_point_clipped(), and m_emesh.
| bool Slic3r::GUI::MeshRaycaster::intersects_line | ( | Vec3d | point, |
| Vec3d | direction, | ||
| const Transform3d & | trafo ) const |
References m_emesh.
|
static |
References Slic3r::GUI::CameraUtils::ray_from_screen_pos().
Referenced by closest_hit(), Slic3r::GUI::GLGizmoCut3D::process_cut_line(), and Slic3r::GUI::GLGizmoCut3D::unproject_on_cut_plane().
| bool Slic3r::GUI::MeshRaycaster::unproject_on_mesh | ( | const Vec2d & | mouse_pos, |
| const Transform3d & | trafo, | ||
| const Camera & | camera, | ||
| Vec3f & | position, | ||
| Vec3f & | normal, | ||
| const ClippingPlane * | clipping_plane = nullptr, | ||
| size_t * | facet_idx = nullptr, | ||
| bool | sinking_limit = true ) const |
References Slic3r::GUI::ClippingPlane::is_point_clipped(), m_emesh, Slic3r::normal(), Slic3r::GUI::CameraUtils::ray_from_screen_pos(), and Slic3r::SINKING_Z_THRESHOLD.
|
private |
|
private |
Referenced by MeshRaycaster().
|
private |
Referenced by MeshRaycaster(), get_closest_point(), and get_triangle_normal().