Skip to content

Commit

Permalink
Expose new crop functions in Python
Browse files Browse the repository at this point in the history
  • Loading branch information
victorreijgwart committed Dec 18, 2024
1 parent e1384ba commit e0700f1
Showing 1 changed file with 31 additions and 13 deletions.
44 changes: 31 additions & 13 deletions library/python/src/edit.cc
Original file line number Diff line number Diff line change
Expand Up @@ -93,22 +93,40 @@ void add_edit_module(nb::module_& m_edit) {
},
"map"_a, "transformation"_a);

// Crop a map
// Crop a map to a box
m_edit.def(
"crop_to_sphere",
[](HashedWaveletOctree& map, const Point3D& t_W_center,
FloatingPoint radius, IndexElement termination_height) {
edit::crop_to_sphere(map, t_W_center, radius, termination_height,
std::make_shared<ThreadPool>());
"crop",
[](HashedWaveletOctree& map, const AABB<Point3D>& aabb,
IndexElement termination_height) {
edit::crop(map, aabb, termination_height,
std::make_shared<ThreadPool>());
},
"map"_a, "center_point"_a, "radius"_a, "termination_height"_a = 0);
"map"_a, "aabb"_a, "termination_height"_a = 0);
m_edit.def(
"crop",
[](HashedChunkedWaveletOctree& map, const AABB<Point3D>& aabb,
IndexElement termination_height) {
edit::crop(map, aabb, termination_height,
std::make_shared<ThreadPool>());
},
"map"_a, "aabb"_a, "termination_height"_a = 0);

// Crop a map to a sphere
m_edit.def(
"crop_to_sphere",
[](HashedChunkedWaveletOctree& map, const Point3D& t_W_center,
FloatingPoint radius, IndexElement termination_height) {
edit::crop_to_sphere(map, t_W_center, radius, termination_height,
std::make_shared<ThreadPool>());
"crop",
[](HashedWaveletOctree& map, const Sphere<Point3D>& sphere,
IndexElement termination_height) {
edit::crop(map, sphere, termination_height,
std::make_shared<ThreadPool>());
},
"map"_a, "sphere"_a, "termination_height"_a = 0);
m_edit.def(
"crop",
[](HashedChunkedWaveletOctree& map, const Sphere<Point3D>& sphere,
IndexElement termination_height) {
edit::crop(map, sphere, termination_height,
std::make_shared<ThreadPool>());
},
"map"_a, "center_point"_a, "radius"_a, "termination_height"_a = 0);
"map"_a, "sphere"_a, "termination_height"_a = 0);
}
} // namespace wavemap

0 comments on commit e0700f1

Please sign in to comment.