Skip to content

Commit f369a94

Browse files
Huangzizhoudaniel-zintzfergus
authored
Geometric Contact Potential (#191)
Implementation of the SIGGRAPH 2025 paper "Geometric Contact Potential". The implementation includes the collision and friction potential, and their gradient and Hessian. --------- Co-authored-by: Daniel Zint <[email protected]> Co-authored-by: Zachary Ferguson <[email protected]>
1 parent fc15b8e commit f369a94

File tree

116 files changed

+26175
-107
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

116 files changed

+26175
-107
lines changed

.clang-tidy

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ Checks: >
88
99
# Bug Detection and Safety
1010
bugprone-*,
11+
# misc-const-correctness,
1112
1213
# Specific high-value checks (even if not in a group above)
1314
google-runtime-int,
@@ -27,7 +28,10 @@ Checks: >
2728
-readability-isolate-declaration,
2829
-readability-magic-numbers,
2930
-readability-math-missing-parentheses,
30-
-readability-redundant-access-specifiers
31+
-readability-redundant-access-specifiers,
32+
-readability-uppercase-literal-suffix,
33+
-readability-function-size,
34+
-readability-convert-member-functions-to-static
3135
3236
WarningsAsErrors: '*'
3337
HeaderFilterRegex: '.*(ipc/).*'

.github/workflows/coverage.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ jobs:
7272
lcov --remove coverage.info --ignore-errors unused '/usr/*' "$HOME/.cache/*" "*tests/*" --output-file coverage.info
7373
7474
- name: Upload coverage reports to Codecov
75-
uses: codecov/codecov-action@v3.1.6
75+
uses: codecov/codecov-action@v5.5.1
7676
with:
7777
fail_ci_if_error: true
7878
files: build/coverage.info

.pre-commit-config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
repos:
22
- repo: https://github.com/pre-commit/mirrors-clang-format
3-
rev: v14.0.0
3+
rev: v21.1.2
44
hooks:
55
- id: clang-format
66
name: clang-format
77
description: "Use clang-format to format C/C++ code"
8-
entry: clang-format-20
8+
entry: clang-format
99
args:
1010
- --style=file
1111
- --verbose

CMakeLists.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,11 @@ target_link_libraries(ipc_toolkit PRIVATE simple_bvh::simple_bvh)
176176
include(spdlog)
177177
target_link_libraries(ipc_toolkit PUBLIC spdlog::spdlog)
178178

179+
# TinyAD
180+
include(tinyad)
181+
# TODO: Make this a private dependency once we stop exposing TinyAD types in the public API.
182+
target_link_libraries(ipc_toolkit PUBLIC TinyAD::TinyAD)
183+
179184
# CCD
180185
if(IPC_TOOLKIT_WITH_INEXACT_CCD)
181186
# Etienne Vouga's CTCD Library for the floating point root finding algorithm

cmake/ipc_toolkit/ipc_toolkit_tests_data.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ else()
3030
SOURCE_DIR ${IPC_TOOLKIT_TESTS_DATA_DIR}
3131

3232
GIT_REPOSITORY https://github.com/ipc-sim/ipc-toolkit-tests-data.git
33-
GIT_TAG 0c6ce752d020db32f62da37d7b8ca9f73c204b36
33+
GIT_TAG 7ca6db695adcc00d3d6d978767dfc0d81722a515
3434

3535
CONFIGURE_COMMAND ""
3636
BUILD_COMMAND ""

cmake/recipes/scalable_ccd.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ message(STATUS "Third-party: creating target 'scalable_ccd::scalable_ccd'")
88

99
include(CPM)
1010
CPMAddPackage(
11-
URI "gh:continuous-collision-detection/scalable-ccd#4fa806f533b19132e696a2dddeab16537025b5f9"
11+
URI "gh:continuous-collision-detection/scalable-ccd#c80af01cab083b3eeb8dac80312ec9cfe479a5cf"
1212
OPTIONS "SCALABLE_CCD_WITH_CUDA ${IPC_TOOLKIT_WITH_CUDA}"
1313
)
1414

cmake/recipes/spdlog.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ option(SPDLOG_INSTALL "Generate the install target" ON)
1010
set(CMAKE_INSTALL_DEFAULT_COMPONENT_NAME "spdlog")
1111

1212
include(CPM)
13-
CPMAddPackage("gh:gabime/spdlog@1.11.0")
13+
CPMAddPackage("gh:gabime/spdlog@1.15.3")
1414

1515
set_target_properties(spdlog PROPERTIES POSITION_INDEPENDENT_CODE ON)
1616

cmake/recipes/tinyad.cmake

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# TinyAD (https://github.com/patr-schm/tinyad)
2+
# License: MIT
3+
if(TARGET TinyAD::TinyAD)
4+
return()
5+
endif()
6+
7+
message(STATUS "Third-party: creating target 'TinyAD::TinyAD'")
8+
9+
include(CPM)
10+
CPMAddPackage(
11+
URI "gh:zfergus/tinyad#957ede5bcf4b8d924f27230083508c664a9f7a7d"
12+
OPTIONS "TINYAD_PARALLEL_BACKEND onetbb"
13+
)
14+
15+
# Folder name for IDE
16+
set_target_properties(TinyAD PROPERTIES FOLDER "ThirdParty")

docs/source/developers/tools.rst

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
Tools for Developers
2+
=====================
3+
4+
Using Pre-Commit Hooks
5+
----------------------
6+
7+
Use the ``.pre-commit-config.yaml`` file to apply clang-format on before commits.
8+
9+
Steps:
10+
1. ``pip install pre-commit``
11+
2. ``pre-commit install``
12+
3. ``git add . && git commit -m "My commit message"``
13+
14+
Hopefully, that will avoid upsetting the GitHub checks :slightly_smiling_face:
15+
16+
Clang-Tidy
17+
----------
18+
19+
To run locally:
20+
21+
1. `Install clang-tidy on mac <https://stackoverflow.com/questions/53111082/how-to-install-clang-tidy-on-macos/78243685#78243685>`_
22+
2. ``cd build; cmake -DCMAKE_EXPORT_COMPILE_COMMANDS=ON ..``: this exports a JSON describing how all the files will be compiled
23+
3. ``cd ..; run-clang-tidy -quiet -p build $(find src -name '*.cpp')``
24+
25+
You can also tack on a ``-j <N>`` to run-clang-tidy to make it parallel.

python/src/bindings.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,8 @@ PYBIND11_MODULE(ipctk, m)
8888
define_smooth_friction_mollifier(m);
8989
define_smooth_mu(m);
9090

91+
define_smooth_potential(m);
92+
9193
// implicits
9294
define_plane_implicit(m);
9395

0 commit comments

Comments
 (0)