12#ifndef EASY3D_ALGO_TRIANGLE_MESH_KDTREE_H
13#define EASY3D_ALGO_TRIANGLE_MESH_KDTREE_H
16#include <easy3d/core/surface_mesh.h>
59 typedef std::vector<Triangle> Triangles;
63 Node() : faces(nullptr), left_child(nullptr), right_child(nullptr) {};
79 unsigned int build_recurse(Node *node,
unsigned int max_handles,
unsigned int depth);
82 void nearest_recurse(Node *node,
const vec3 &point, NearestNeighbor &data)
const;
A halfedge data structure for polygonal meshes of 2-manifold.
Definition: surface_mesh.h:52
A k-d tree for triangular surface meshes.
Definition: triangle_mesh_kdtree.h:24
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
void split(const std::string &in, char separator, std::vector< std::string > &out, bool skip_empty_fields)
Splits a string into parts.
Definition: string.cpp:24
Definition: collider.cpp:182
Vec< 3, float > vec3
A 3D point/vector of float type.
Definition: types.h:45
Definition: surface_mesh.h:134
nearest neighbor information
Definition: triangle_mesh_kdtree.h:32