Skip to content

Commit 5167a11

Browse files
yutingyemeta-codesync[bot]
authored andcommitted
Expose support contact geometry helpers (#1552)
Summary: Pull Request resolved: #1552 Exposes the shared Momentum support-contact and support-polygon helpers through `pymomentum.geometry`. The binding layer now only marshals NumPy skeleton/contact arrays while Momentum owns floor-locator, plane-collision, and convex-hull computations. `support_polygon` now uses Momentum's positions-only support-contact helper so it does not build parent-index, parent-offset, or floor-position arrays when only hull inputs are needed. The binding also documents that skeleton-state conversion populates only world transforms for these geometry helpers and makes the default plane u-axis fallback robust when the normal is parallel to the preferred axis. Reviewed By: cstollmeta Differential Revision: D109891382 fbshipit-source-id: 22ebf00ab14393ffca397726d256a6e0b7c554f0
1 parent 81b0de1 commit 5167a11

5 files changed

Lines changed: 505 additions & 0 deletions

File tree

pymomentum/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,7 @@ mt_python_binding(
200200
LINK_LIBRARIES
201201
array_utility
202202
character
203+
character_solver
203204
io_character
204205
io_fbx
205206
io_file_save_options
@@ -209,6 +210,7 @@ mt_python_binding(
209210
io_shape
210211
io_skeleton
211212
io_urdf
213+
math
212214
python_utility
213215
)
214216

pymomentum/cmake/build_variables.bzl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,7 @@ geometry_public_headers = [
154154
"geometry/sdf_collider_pybind.h",
155155
"geometry/skeleton_pybind.h",
156156
"geometry/skin_weights_pybind.h",
157+
"geometry/support_contacts_pybind.h",
157158
"geometry/texture_classification.h",
158159
]
159160

@@ -180,6 +181,7 @@ geometry_sources = [
180181
"geometry/sdf_collider_pybind.cpp",
181182
"geometry/skeleton_pybind.cpp",
182183
"geometry/skin_weights_pybind.cpp",
184+
"geometry/support_contacts_pybind.cpp",
183185
"geometry/texture_classification.cpp",
184186
]
185187

pymomentum/geometry/geometry_pybind.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
#include "pymomentum/geometry/sdf_collider_pybind.h"
2626
#include "pymomentum/geometry/skeleton_pybind.h"
2727
#include "pymomentum/geometry/skin_weights_pybind.h"
28+
#include "pymomentum/geometry/support_contacts_pybind.h"
2829
#include "pymomentum/geometry/texture_classification.h"
2930
#include "pymomentum/python_utility/eigen_quaternion.h"
3031

@@ -1229,6 +1230,8 @@ Supports arbitrary leading dimensions with broadcasting and both float32/float64
12291230
py::arg("character"),
12301231
py::arg("joint_parameters"));
12311232

1233+
addSupportContactBindings(m);
1234+
12321235
// jointParametersToLocalSkeletonState(character, jointParameters)
12331236
m.def(
12341237
"joint_parameters_to_local_skeleton_state",

0 commit comments

Comments
 (0)