12#ifndef EASY3D_ALGO_TRIANGLE_MESH_KDTREE_H
13#define EASY3D_ALGO_TRIANGLE_MESH_KDTREE_H
16#include <easy3d/core/surface_mesh.h>
70 typedef std::vector<Triangle> Triangles;
74 Node() : faces(nullptr), left_child(nullptr), right_child(nullptr) {};
90 unsigned int build_recurse(Node *node,
unsigned int max_handles,
unsigned int depth);
A halfedge data structure for polygonal meshes of 2-manifold.
Definition surface_mesh.h:51
~TriangleMeshKdTree()
Destructor.
Definition triangle_mesh_kdtree.h:36
TriangleMeshKdTree(const SurfaceMesh *mesh, unsigned int max_faces=10, unsigned int max_depth=30)
Construct with mesh.
Definition triangle_mesh_kdtree.cpp:21
NearestNeighbor nearest(const vec3 &p) const
Return handle of the nearest neighbor.
Definition triangle_mesh_kdtree.cpp:160
Definition collider.cpp:182
Vec< 3, float > vec3
A 3D point/vector of float type.
Definition types.h:44
Definition surface_mesh.h:191
Nearest neighbor information.
Definition triangle_mesh_kdtree.h:39
float dist
distance to the nearest neighbor
Definition triangle_mesh_kdtree.h:40
vec3 nearest
nearest point on the face
Definition triangle_mesh_kdtree.h:42
SurfaceMesh::Face face
face handle of the nearest neighbor
Definition triangle_mesh_kdtree.h:41