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);
93 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:51
A k-d tree for triangular surface meshes.
Definition triangle_mesh_kdtree.h:24
~TriangleMeshKdTree()
Destructor.
Definition triangle_mesh_kdtree.h:36
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:26
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