RSMesh 1.0.0
一个曲面重构的系统,输入为点云,输出为obj,stl等主流格式的网格文件,使用的方法为径向基函数插值,采取了并行优化、Intel-MKL等优化措施,支持百万级别的点云
载入中...
搜索中...
未找到
kdtree.h
1//
2// Created by RainSure on 2023/10/27.
3//
4
5#ifndef RSMESH_KDTREE_H
6#define RSMESH_KDTREE_H
7
8#include <vector>
9#include <memory>
10#include <utility>
11
12#include "geometry/point3d.h"
13#include "types.h"
14
15namespace rsmesh {
16 namespace point_cloud {
22 class kdtree {
23 public:
24 using indices_and_distaces = std::pair<std::vector<index_t>, std::vector<double>>;
25
31 kdtree(const geometry::points3d& points, bool use_exact_search);
32
37
38 kdtree(const kdtree&) = delete; // 禁用默认的拷贝构造函数
39 kdtree(kdtree&&) = delete; // 禁用默认的移动构造函数
40 kdtree& operator=(const kdtree&) = delete; // 禁用默认的拷贝赋值函数
41 kdtree& operator=(kdtree&&) = delete; // 禁用默认的移动赋值函数
42
49 [[nodiscard]] indices_and_distaces knn_search(const geometry::point3d& point, index_t k) const;
50
57 [[nodiscard]] indices_and_distaces radius_search(const geometry::point3d& point, double radius) const;
58
59 private:
60 class impl; // 前置声明, Pimpl设计模式
61 std::unique_ptr<impl> impl_;
62 };
63
64 } // rsmesh
65} // point_cloud
66
67#endif //RSMESH_KDTREE_H
用于在点云中搜索最近邻点的kdtree,利用flann库来进行实现
Definition kdtree.h:22
indices_and_distaces knn_search(const geometry::point3d &point, index_t k) const
搜索距离某个点最近的k个点
Definition kdtree.cpp:87
indices_and_distaces radius_search(const geometry::point3d &point, double radius) const
搜索出距离某个点距离小于等于radius的全部点
Definition kdtree.cpp:98
kdtree(const geometry::points3d &points, bool use_exact_search)
构造函数
Definition kdtree.cpp:82
vectors3d points3d
3维点的集合
Definition point3d.h:48
vector3d point3d
3维点
Definition point3d.h:39
本系统的主命名空间,包含了common, examples, fmm, geometry, numeric, point_cloud等子命名空间