|
| template<typename VertexType, typename IndexedFaceType> |
| 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) |
| template<typename VertexType, typename IndexedFaceType, typename TreeType, typename VectorType> |
| 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) |
| template<typename VertexType, typename IndexedFaceType, typename TreeType, typename VectorType> |
| 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) |
| template<typename VertexType, typename IndexedFaceType, typename TreeType, typename VectorType> |
| 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) |
| template<typename VertexType, typename IndexedFaceType, typename TreeType, typename VectorType> |
| bool | is_any_triangle_in_radius (const std::vector< VertexType > &vertices, const std::vector< IndexedFaceType > &faces, const TreeType &tree, const VectorType &point, typename VectorType::Scalar &max_distance_squared) |
| template<typename VertexType, typename IndexedFaceType, typename TreeType, typename VectorType> |
| std::vector< size_t > | all_triangles_in_radius (const std::vector< VertexType > &vertices, const std::vector< IndexedFaceType > &faces, const TreeType &tree, const VectorType &point, typename VectorType::Scalar max_distance_squared) |
| template<typename TreeType, typename VectorType> |
| void | get_candidate_idxs (const TreeType &tree, const VectorType &v, std::vector< size_t > &candidates, size_t node_idx=0) |
| template<class G> |
| auto | intersecting (const G &g) |
| template<class G> |
| auto | within (const G &g) |
| template<int Dims, typename T, typename Predicate, typename Fn> |
| void | traverse (const Tree< Dims, T > &tree, Predicate &&pred, Fn &&callback) |
template<typename VertexType, typename IndexedFaceType>
| Tree< 3, typename VertexType::Scalar > Slic3r::AABBTreeIndirect::build_aabb_tree_over_indexed_triangle_set |
( |
const std::vector< VertexType > & | vertices, |
|
|
const std::vector< IndexedFaceType > & | faces, |
|
|
const typename VertexType::Scalar | eps = 0 ) |
|
inline |
684{
686
687 using VectorType = typename TreeType::VectorType;
688 using BoundingBox =
typename TreeType::BoundingBox;
689
690 struct InputType {
691 size_t idx() const { return m_idx; }
693 const VectorType& centroid() const { return m_centroid; }
694
695 size_t m_idx;
696 BoundingBox m_bbox;
697 VectorType m_centroid;
698 };
699
700 std::vector<InputType> input;
701 input.reserve(faces.size());
702 const VectorType veps(eps, eps, eps);
703 for (size_t i = 0; i < faces.size(); ++ i) {
704 const IndexedFaceType &face = faces[i];
705 const VertexType &v1 = vertices[face(0)];
706 const VertexType &v2 = vertices[face(1)];
707 const VertexType &v3 = vertices[face(2)];
708 InputType n;
709 n.m_idx = i;
710 n.m_centroid = (1./3.) * (v1 + v2 + v3);
711 n.m_bbox = BoundingBox(v1, v1);
712 n.m_bbox.extend(v2);
713 n.m_bbox.extend(v3);
714 n.m_bbox.min() -= veps;
715 n.m_bbox.max() += veps;
716 input.emplace_back(n);
717 }
718
719 TreeType out;
720 out.build(std::move(input));
721 return out;
722}
Definition AABBTreeIndirect.hpp:45
Definition BoundingBox.hpp:212
Referenced by Slic3r::anonymous_namespace{TextureDisplacement.cpp}::build_texture_displacement_v2(), Slic3r::SeamPlacerImpl::compute_global_occlusion(), Slic3r::SeamPlacerImpl::gather_enforcers_blockers(), Slic3r::AABBMesh::AABBImpl::init(), Slic3r::sla::IndexedMesh::AABBImpl::init(), Slic3r::GUI::GLGizmoTextureDisplacement::prepare_mesh(), Slic3r::anonymous_namespace{TextureDisplacement.cpp}::prepare_sampleable_layers(), Slic3r::TriangleSelector::remap_painting(), Slic3r::tex2color::color_utils::remesh_mesh(), Slic3r::tex2color::repair_cluster_smooth(), Slic3r::transfer_facet_paint(), and Slic3r::transfer_uv_channel().