10 #include <pybind11/stl.h>
11 #include <pybind11/stl_bind.h>
26 py::class_<Geometry, PyGeometry<Geometry>, std::shared_ptr<Geometry>>
27 geometry(m,
"Geometry",
"The base geometry class.");
30 "Clear all elements in the geometry.")
32 "Returns ``True`` iff the geometry is empty.");
34 "Returns the device of the geometry.");
36 "Returns true if the geometry is on CPU.");
38 "Returns true if the geometry is on CUDA.");
44 py::module m_submodule = m.def_submodule(
45 "geometry",
"Tensor-based geometry defining module.");
46 py::bind_vector<std::vector<Metric>>(m_submodule,
"VectorMetric");
48 py::native_enum<Metric>(
49 m_submodule,
"Metric",
"enum.Enum",
50 "Enum for metrics for comparing point clouds and triangle meshes.")
58 py::class_<MetricParameters> metric_parameters(
59 m_submodule,
"MetricParameters",
60 "Holder for various parameters required by metrics.");
62 py::native_enum<MethodOBBCreate>(
63 m_submodule,
"MethodOBBCreate",
"enum.Enum",
64 "Methods for creating oriented bounding boxes.")
74 .def(py::init([](
const std::deque<float>& fsr,
size_t nsp) {
75 std::vector<float> fsrvec{fsr.begin(), fsr.end()};
78 "fscore_radius"_a = std::deque<float>{0.01f},
79 "n_sampled_points"_a = 1000)
83 return std::deque<float>(
self.fscore_radius.begin(),
84 self.fscore_radius.end());
87 const std::deque<float>& fsr) {
89 std::vector<float>(fsr.begin(), fsr.end());
91 "Radius for computing the F-Score. A match between "
92 "a point and its nearest neighbor is sucessful if "
93 "it is within this radius.")
94 .def_readwrite(
"n_sampled_points",
96 "Points are sampled uniformly from the surface of "
97 "triangle meshes before distance computation. This "
98 "specifies the number of points sampled. No "
99 "sampling is done for point clouds.")
virtual core::Device GetDevice() const =0
Returns the device of the geometry.
virtual Geometry & Clear()=0
Clear all elements in the geometry.
virtual bool IsEmpty() const =0
Returns true iff the geometry is empty.
void ClassMethodDocInject(py::module &pybind_module, const std::string &class_name, const std::string &function_name, const std::unordered_map< std::string, std::string > &map_parameter_body_docs)
void pybind_trianglemesh(py::module &m)
void pybind_voxel_block_grid(py::module &m)
void pybind_lineset(py::module &m)
void pybind_geometry(py::module &m)
void pybind_boundingvolume(py::module &m)
void pybind_image(py::module &m)
void pybind_raycasting_scene(py::module &m)
void pybind_geometry_class(py::module &m)
@ ChamferDistance
Chamfer Distance.
@ HausdorffDistance
Hausdorff Distance.
void pybind_tensormap(py::module &m)
void pybind_pointcloud(py::module &m)
@ MINIMAL_APPROX
Minimal OBB approximation.
@ PCA
Principal Component Analysis.
@ MINIMAL_JYLANKI
Minimal OBB by Jylanki.
void pybind_drawable_geometry(py::module &m)
Generic file read and write utility for python interface.
Holder for various parameters required by metrics.
std::string ToString() const