OrcaSlicer latest
OrcaSlicer
Loading...
Searching...
No Matches
Slic3r::sla::IndexedMesh::AABBImpl Class Reference

Public Member Functions

void init (const indexed_triangle_set &its, bool calculate_epsilon)
void intersect_ray (const indexed_triangle_set &its, const Vec3d &s, const Vec3d &dir, igl::Hit< float > &hit)
void intersect_ray (const indexed_triangle_set &its, const Vec3d &s, const Vec3d &dir, std::vector< igl::Hit< float > > &hits)
double squared_distance (const indexed_triangle_set &its, const Vec3d &point, int &i, Eigen::Matrix< double, 1, 3 > &closest)

Private Attributes

AABBTreeIndirect::Tree3f m_tree
double m_triangle_ray_epsilon

Detailed Description

Member Function Documentation

◆ init()

void Slic3r::sla::IndexedMesh::AABBImpl::init ( const indexed_triangle_set & its,
bool calculate_epsilon )
inline
38 {
39 m_triangle_ray_epsilon = 0.000001;
40 if (calculate_epsilon) {
41 // Calculate epsilon from average triangle edge length.
42 double l = its_average_edge_length(its);
43 if (l > 0)
44 m_triangle_ray_epsilon = 0.000001 * l * l;
45 }
47 its.vertices, its.indices);
48 }
AABBTreeIndirect::Tree3f m_tree
Definition IndexedMesh.cpp:33
double m_triangle_ray_epsilon
Definition IndexedMesh.cpp:34
Tree< 3, typename VertexType::Scalar > build_aabb_tree_over_indexed_triangle_set(const std::vector< VertexType > &vertices, const std::vector< IndexedFaceType > &faces, const typename VertexType::Scalar eps=0)
Definition AABBTreeIndirect.hpp:677
float its_average_edge_length(const indexed_triangle_set &its)
Definition TriangleMesh.cpp:1535

References Slic3r::AABBTreeIndirect::build_aabb_tree_over_indexed_triangle_set(), Slic3r::its_average_edge_length(), m_tree, and m_triangle_ray_epsilon.

Here is the call graph for this function:

◆ intersect_ray() [1/2]

void Slic3r::sla::IndexedMesh::AABBImpl::intersect_ray ( const indexed_triangle_set & its,
const Vec3d & s,
const Vec3d & dir,
igl::Hit< float > & hit )
inline
54 {
55 AABBTreeIndirect::intersect_ray_first_hit(its.vertices, its.indices,
56 m_tree, s, dir, hit, m_triangle_ray_epsilon);
57 }
bool intersect_ray_first_hit(const std::vector< VertexType > &vertices, const std::vector< IndexedFaceType > &faces, const TreeType &tree, const VectorType &origin, const VectorType &dir, igl::Hit< float > &hit, const double eps=0.000001)
Definition AABBTreeIndirect.hpp:728

References Slic3r::AABBTreeIndirect::intersect_ray_first_hit(), m_tree, and m_triangle_ray_epsilon.

Here is the call graph for this function:

◆ intersect_ray() [2/2]

void Slic3r::sla::IndexedMesh::AABBImpl::intersect_ray ( const indexed_triangle_set & its,
const Vec3d & s,
const Vec3d & dir,
std::vector< igl::Hit< float > > & hits )
inline
63 {
64 AABBTreeIndirect::intersect_ray_all_hits(its.vertices, its.indices,
65 m_tree, s, dir, hits, m_triangle_ray_epsilon);
66 }
bool intersect_ray_all_hits(const std::vector< VertexType > &vertices, const std::vector< IndexedFaceType > &faces, const TreeType &tree, const VectorType &origin, const VectorType &dir, std::vector< igl::Hit< float > > &hits, const double eps=0.000001)
Definition AABBTreeIndirect.hpp:760

References Slic3r::AABBTreeIndirect::intersect_ray_all_hits(), m_tree, and m_triangle_ray_epsilon.

Here is the call graph for this function:

◆ squared_distance()

double Slic3r::sla::IndexedMesh::AABBImpl::squared_distance ( const indexed_triangle_set & its,
const Vec3d & point,
int & i,
Eigen::Matrix< double, 1, 3 > & closest )
inline
72 {
73 size_t idx_unsigned { 0 };
74 Vec3d closest_vec3d { Vec3d::Zero() };
75 const double dist {
77 its.vertices, its.indices, m_tree, point, idx_unsigned,
78 closest_vec3d) };
79 i = int(idx_unsigned);
80 closest = closest_vec3d;
81 return dist;
82 }
VectorType::Scalar squared_distance_to_indexed_triangle_set(const std::vector< VertexType > &vertices, const std::vector< IndexedFaceType > &faces, const TreeType &tree, const VectorType &point, size_t &hit_idx_out, Eigen::PlainObjectBase< VectorType > &hit_point_out)
Definition AABBTreeIndirect.hpp:801
T dist(const boost::polygon::point_data< T > &p1, const boost::polygon::point_data< T > &p2)
Definition Geometry.cpp:298
Foot closest(const Contour &c, const Vec2d &p, double stop=-1.0, const std::vector< Vec2d > *source_normals=nullptr, double normal_cosine=0.0)
Definition SeamContour.cpp:36
Eigen::Matrix< double, 3, 1, Eigen::DontAlign > Vec3d
Definition SpatIndex.hpp:18

References Slic3r::Geometry::dist(), m_tree, and Slic3r::AABBTreeIndirect::squared_distance_to_indexed_triangle_set().

Here is the call graph for this function:

Member Data Documentation

◆ m_tree

AABBTreeIndirect::Tree3f Slic3r::sla::IndexedMesh::AABBImpl::m_tree
private

◆ m_triangle_ray_epsilon

double Slic3r::sla::IndexedMesh::AABBImpl::m_triangle_ray_epsilon
private

Referenced by init(), intersect_ray(), and intersect_ray().


The documentation for this class was generated from the following file:
  • /home/runner/work/OrcaSlicer/OrcaSlicer/src/libslic3r/SLA/IndexedMesh.cpp