-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Expose methods to sum shapes into map through Python API
- Loading branch information
1 parent
759669b
commit 68bf7a9
Showing
11 changed files
with
136 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#ifndef PYWAVEMAP_GEOMETRY_H_ | ||
#define PYWAVEMAP_GEOMETRY_H_ | ||
|
||
#include <nanobind/nanobind.h> | ||
|
||
namespace nb = nanobind; | ||
|
||
namespace wavemap { | ||
void add_geometry_bindings(nb::module_& m); | ||
} | ||
|
||
#endif // PYWAVEMAP_GEOMETRY_H_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
#include "pywavemap/geometry.h" | ||
|
||
#include <nanobind/eigen/dense.h> | ||
#include <wavemap/core/common.h> | ||
#include <wavemap/core/utils/geometry/aabb.h> | ||
#include <wavemap/core/utils/geometry/sphere.h> | ||
|
||
using namespace nb::literals; // NOLINT | ||
|
||
namespace wavemap { | ||
void add_geometry_bindings(nb::module_& m) { | ||
// Axis-Aligned Bounding Box | ||
nb::class_<AABB<Point3D>>( | ||
m, "AABB", "A class representing an Axis-Aligned Bounding Box.") | ||
.def(nb::init()) | ||
.def(nb::init<Point3D, Point3D>(), "min"_a, "max"_a) | ||
.def_rw("min", &AABB<Point3D>::min) | ||
.def_rw("max", &AABB<Point3D>::max) | ||
.def("insert", &AABB<Point3D>::insert, | ||
"Expand the AABB to tightly fit the new point " | ||
"and its previous self.") | ||
.def("contains", &AABB<Point3D>::contains, | ||
"Test whether the AABB contains the given point."); | ||
|
||
// Axis-Aligned Bounding Box | ||
nb::class_<Sphere<Point3D>>(m, "Sphere", "A class representing a sphere.") | ||
.def(nb::init()) | ||
.def(nb::init<Point3D, FloatingPoint>(), "center"_a, "radius"_a) | ||
.def_rw("center", &Sphere<Point3D>::center) | ||
.def_rw("radius", &Sphere<Point3D>::radius) | ||
.def("contains", &Sphere<Point3D>::contains, | ||
"Test whether the sphere contains the given point."); | ||
} | ||
} // namespace wavemap |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters