Commit 250c871 1 parent 534d819 commit 250c871 Copy full SHA for 250c871
File tree 4 files changed +50
-4
lines changed
4 files changed +50
-4
lines changed Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ find_package(Python REQUIRED COMPONENTS Interpreter Development)
2
2
find_package (nanobind CONFIG REQUIRED)
3
3
4
4
set (PYTHON_LIB_NAME_V2 coal_pywrap_v2)
5
- set (coal_pywrap_v2_SOURCES module.cc)
5
+ set (coal_pywrap_v2_SOURCES math.cc module.cc)
6
6
7
7
nanobind_add_module(${PYTHON_LIB_NAME_V2} NB_STATIC LTO NB_SUPPRESS_WARNINGS ${coal_pywrap_v2_SOURCES} )
8
8
target_link_libraries (
Original file line number Diff line number Diff line change
1
+ #include < nanobind/nanobind.h>
2
+
3
+ namespace nb = nanobind;
Original file line number Diff line number Diff line change
1
+ // / Copyright 2025 INRIA
2
+ #include " coal/math/transform.h"
3
+
4
+ #include " fwd.h"
5
+ #include < nanobind/eigen/dense.h>
6
+ #include < nanobind/operators.h>
7
+
8
+ using namespace coal ;
9
+
10
+ void exposeMaths (nb::module_ &m) {
11
+ nb::module_::import_ (" nanoeigenpy" );
12
+
13
+ nb::class_<Transform3s>(m, " Transform3s" )
14
+ .def (nb::init<>())
15
+ .def (" getQuatRotation" , &Transform3s::getQuatRotation,
16
+ nb::rv_policy::automatic_reference)
17
+ .def (" getTranslation" , &Transform3s::getTranslation,
18
+ nb::rv_policy::automatic_reference)
19
+ .def (" isIdentity" , &Transform3s::isIdentity)
20
+ .def (" setIdentity" , &Transform3s::setIdentity)
21
+
22
+ .def (" setRandom" , &Transform3s::setRandom)
23
+ .def_static (" Random" , &Transform3s::Random)
24
+
25
+ .def (nb::self * nb::self)
26
+ .def (nb::self *= nb::self)
27
+ .def (nb::self == nb::self)
28
+ .def (nb::self != nb::self);
29
+ }
Original file line number Diff line number Diff line change 1
1
// / Copyright 2025 INRIA
2
- #include < nanobind/nanobind.h >
2
+ #include " fwd.h "
3
3
#include " coal/config.hh"
4
4
5
- namespace nb = nanobind;
6
5
using namespace nb ::literals;
7
6
8
7
inline constexpr bool checkVersionAtLeast (int major, int minor, int patch) {
@@ -44,4 +43,19 @@ void exposeVersion(nb::module_ &m) {
44
43
" by the input arguments." );
45
44
}
46
45
47
- NB_MODULE (COAL_PYTHON_LIBNAME, m) { exposeVersion (m); }
46
+ void exposeMaths (nb::module_ &m);
47
+
48
+ void exposeCollisionGeometries (nb::module_ &m);
49
+
50
+ void exposeGJK (nb::module_ &m);
51
+
52
+ #ifdef COAL_HAS_OCTOMAP
53
+ void exposeOctree (nb::module_ &m);
54
+ #endif
55
+
56
+ void exposeBroadPhase (nb::module_ &m);
57
+
58
+ NB_MODULE (COAL_PYTHON_LIBNAME, m) {
59
+ exposeVersion (m);
60
+ exposeMaths (m);
61
+ }
You can’t perform that action at this time.
0 commit comments