Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
480645a
Add two-stage barrier
zfergus Jun 27, 2025
be47660
Add conversion functions for edge-vertex and face-vertex candidates i…
zfergus Jun 27, 2025
c5ee3a2
Add compute_per_vertex_safe_distances to Candidates
zfergus Jun 27, 2025
d230b32
Replace unordered_set with vector in CollisionMesh
zfergus Jun 28, 2025
9de047a
Refactor NormalCollisions to support multiple collision set types
zfergus Jul 1, 2025
4b3d966
Merge branch 'main' into ogc
zfergus Jul 1, 2025
c2fed90
Fix python tests
zfergus Jul 1, 2025
6e2c245
Parallelize using atomic min
zfergus Jul 5, 2025
4575c0c
Parallelize compute_noncandidate_conservative_stepsize
zfergus Jul 9, 2025
a412e5c
Failed attempt to compute_per_vertex_collision_free_stepsize
zfergus Jul 22, 2025
8f1e449
Merge branch 'main' into ogc
zfergus Jul 22, 2025
0e689f1
Merge branch 'main' into ogc
zfergus Jul 31, 2025
b33c32a
Make tsl::robin_map and absl:hash private dependencies
zfergus Jul 31, 2025
2527c42
Merge branch 'main' into ogc
zfergus Sep 4, 2025
3057dd0
Fix log_and_throw_error to use fmt::runtime for formatting
zfergus Sep 8, 2025
fd3cf3f
Update CMake configuration for Xcode and upgrade spdlog package version
zfergus Sep 25, 2025
4165326
Revert spdlog package version to 1.11.0 and include <optional> in tes…
zfergus Oct 2, 2025
d1ab0c2
Refactor check_vertex_feasible_region to use VectorMax3d for position…
zfergus Oct 2, 2025
d672f85
Merge branch 'main' into ogc
zfergus Oct 3, 2025
c1b46e5
Refactor collision set type in solver.py and improve adjacency assert…
zfergus Oct 3, 2025
9d041b7
Update scalable CCD package URI to a specific commit hash
zfergus Oct 3, 2025
e979199
Fix assert in CollisionMesh::init_adjacencies
zfergus Oct 3, 2025
e122d86
Fix feasibility check in check_vertex_feasible_region to use correct …
zfergus Oct 3, 2025
71bc869
Add unit tests for OGC functionality
zfergus Oct 4, 2025
ba9fb68
Add test for per-vertex safe distances in candidates
zfergus Oct 4, 2025
24f475e
Update GIT_TAG for ipc_toolkit_test_data and modify mesh loading asse…
zfergus Oct 4, 2025
096fd81
Add Python bindings for new features
zfergus Oct 4, 2025
422a171
Refactor OGC module and add trust region helper class
zfergus Oct 6, 2025
455bb91
Add trust region update mechanism and modify filter_step signature
zfergus Oct 6, 2025
3fb3e46
Add assertions for input validation in AABB and TrustRegion classes, …
zfergus Oct 7, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -670,4 +670,5 @@ python/update_bindings.py

# External test data
tests/data
notebooks/*.png
CMakeGraphVizOptions.cmake
6 changes: 3 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -192,13 +192,13 @@ endif()
# Faster unordered map
if(IPC_TOOLKIT_WITH_ROBIN_MAP)
include(robin_map)
target_link_libraries(ipc_toolkit PUBLIC tsl::robin_map)
target_link_libraries(ipc_toolkit PRIVATE tsl::robin_map)
endif()

# Hashes
if(IPC_TOOLKIT_WITH_ABSEIL)
include(abseil)
target_link_libraries(ipc_toolkit PUBLIC absl::hash)
target_link_libraries(ipc_toolkit PRIVATE absl::hash)
endif()

# Intervals
Expand Down Expand Up @@ -297,7 +297,7 @@ endif()
# Xcode
################################################################################

if (CMAKE_GENERATOR STREQUAL "Xcode")
if (IPC_TOOLKIT_TOPLEVEL_PROJECT AND CMAKE_GENERATOR STREQUAL "Xcode")
set(CMAKE_XCODE_SCHEME_LAUNCH_CONFIGURATION "${CMAKE_BUILD_TYPE}")
set_target_properties(ipc_toolkit PROPERTIES XCODE_GENERATE_SCHEME ON)
if(IPC_TOOLKIT_BUILD_TESTS)
Expand Down
6 changes: 3 additions & 3 deletions cmake/ipc_toolkit/ipc_toolkit_tests_data.cmake
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# ipc-toolkit-tests-data (https://github.com/ipc-sim/ipc-toolkit-tests-data)
# ipc-toolkit-test-data (https://github.com/ipc-sim/ipc-toolkit-test-data)
# License: MIT

if(TARGET ipc_toolkit_test_data_download)
Expand Down Expand Up @@ -29,8 +29,8 @@ else()
PREFIX "${FETCHCONTENT_BASE_DIR}/tests/data"
SOURCE_DIR ${IPC_TOOLKIT_TESTS_DATA_DIR}

GIT_REPOSITORY https://github.com/ipc-sim/ipc-toolkit-tests-data.git
GIT_TAG 0c6ce752d020db32f62da37d7b8ca9f73c204b36
GIT_REPOSITORY https://github.com/ipc-sim/ipc-toolkit-test-data.git
GIT_TAG 6c6319ab1dae122a7f7f0c46a4717950cb61b1ce

CONFIGURE_COMMAND ""
BUILD_COMMAND ""
Expand Down
2 changes: 1 addition & 1 deletion cmake/recipes/scalable_ccd.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ message(STATUS "Third-party: creating target 'scalable_ccd::scalable_ccd'")

include(CPM)
CPMAddPackage(
URI "gh:continuous-collision-detection/scalable-ccd#4fa806f533b19132e696a2dddeab16537025b5f9"
URI "gh:continuous-collision-detection/scalable-ccd#c80af01cab083b3eeb8dac80312ec9cfe479a5cf"
OPTIONS "SCALABLE_CCD_WITH_CUDA ${IPC_TOOLKIT_WITH_CUDA}"
)

Expand Down
2 changes: 1 addition & 1 deletion cmake/recipes/spdlog.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ option(SPDLOG_INSTALL "Generate the install target" ON)
set(CMAKE_INSTALL_DEFAULT_COMPONENT_NAME "spdlog")

include(CPM)
CPMAddPackage("gh:gabime/spdlog@1.11.0")
CPMAddPackage("gh:gabime/spdlog@1.15.3")

set_target_properties(spdlog PROPERTIES POSITION_INDEPENDENT_CODE ON)

Expand Down
4 changes: 2 additions & 2 deletions docs/source/_static/graphviz/dependencies.dot
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ digraph "IPC Toolkit Dependencies" {
"node5" -> "node3" [color = "#BE6562";];
// ipc_toolkit -> igl_predicates
"node6" [label = "robin_map\n(tsl::robin_map)";shape = box;style = "rounded,filled";fillcolor = "#FFE6CC";color = "#DAA52D";];
"node5" -> "node6" [color = "#8FB976";];
"node5" -> "node6" [color = "#BE6562";];
// ipc_toolkit -> robin_map
"node7" [label = "scalable_ccd\n(scalable_ccd::scalable_ccd)";shape = box;style = "rounded,filled";fillcolor = "#D5E8D4";color = "#8FB976";];
"node7" -> "node0" [color = "#8FB976";];
Expand Down Expand Up @@ -77,5 +77,5 @@ digraph "IPC Toolkit Dependencies" {
"node5" -> "node11" [color = "#BE6562";];
// ipc_toolkit -> tight_inclusion
"node12" [label = "absl_hash\n(absl::hash)";shape = box;style = "rounded,filled";fillcolor = "#D5E8D4";color = "#8FB976";];
"node5" -> "node12" [color = "#8FB976";];
"node5" -> "node12" [color = "#BE6562";];
}
8 changes: 4 additions & 4 deletions docs/source/_static/graphviz/dependencies.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 2 additions & 1 deletion docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,8 @@
# -- GraphViz configuration ----------------------------------
graphviz_output_format = 'svg'

graphviz_dot_args = ["-Ecolor=#CE93D8", "-Kdot", "-Gbgcolor=transparent", "-Nfontname=Menlo"]
graphviz_dot_args = ["-Ecolor=#CE93D8", "-Kdot",
"-Gbgcolor=transparent", "-Nfontname=Menlo"]

# python_apigen_modules = {
# "ipctk": "",
Expand Down
5 changes: 5 additions & 0 deletions docs/source/cpp-api/barrier/TwoStageBarrier.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Two-Stage Barrier
=================

.. doxygenclass:: ipc::TwoStageBarrier
:allow-dot-graphs:
30 changes: 17 additions & 13 deletions docs/source/cpp-api/barrier/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ Barrier
NormalizedBarrier.rst
ClampedLogSqBarrier.rst
CubicBarrier.rst
TwoStageBarrier.rst

Barrier functions and functionals.

Expand All @@ -21,16 +22,19 @@ Types

* - Name
- Description
* - :doc:`Barrier <Barrier>`
* - :cpp:class:`ipc::Barrier`
- Base class for barrier functions.
* - :doc:`ClampedLogBarrier <ClampedLogBarrier>`
* - :cpp:class:`ipc::ClampedLogBarrier`
- Smoothly clamped log barrier functions from [Li et al.].
* - :doc:`ClampedLogSqBarrier <ClampedLogSqBarrier>`
* - :cpp:class:`ipc::ClampedLogSqBarrier`
- Clamped log barrier with a quadratic log term from [Huang et al.].
* - :doc:`CubicBarrier <CubicBarrier>`
* - :cpp:class:`ipc::CubicBarrier`
- Cubic barrier function from [Ando 2024].
* - :doc:`NormalizedBarrier <NormalizedBarrier>`
* - :cpp:class:`ipc::NormalizedBarrier`
- Normalized barrier function from [Li et al.].
* - :cpp:class:`ipc::TwoStageBarrier`
- Two-stage barrier function from [Chen et al. 2025].


Functions
---------
Expand All @@ -40,21 +44,21 @@ Functions

* - Name
- Description
* - :func:`ipc::barrier`
* - :cpp:func:`ipc::barrier`
- Evaluate the barrier function.
* - :func:`ipc::barrier_first_derivative`
* - :cpp:func:`ipc::barrier_first_derivative`
- Derivative of the barrier function.
* - :func:`ipc::barrier_second_derivative`
* - :cpp:func:`ipc::barrier_second_derivative`
- Second derivative of the barrier function.
* - :func:`ipc::barrier_force_magnitude`
* - :cpp:func:`ipc::barrier_force_magnitude`
- Compute the barrier force magnitude.
* - :func:`ipc::barrier_force_magnitude_gradient`
* - :cpp:func:`ipc::barrier_force_magnitude_gradient`
- Compute the gradient of the barrier force magnitude.
* - :func:`ipc::initial_barrier_stiffness`
* - :cpp:func:`ipc::initial_barrier_stiffness`
- Compute the initial barrier stiffness.
* - :func:`ipc::update_barrier_stiffness`
* - :cpp:func:`ipc::update_barrier_stiffness`
- Update the barrier stiffness based on the current state.
* - :func:`ipc::semi_implicit_stiffness`
* - :cpp:func:`ipc::semi_implicit_stiffness`
- Compute the semi-implicit stiffness for all collisions.

Function Details
Expand Down
1 change: 1 addition & 0 deletions docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
tutorials/getting_started.rst
tutorials/advanced_friction.rst
tutorials/convergent.rst
tutorials/ogc.rst
tutorials/nonlinear_ccd.rst
tutorials/adhesion.rst
tutorials/simulation.rst
Expand Down
7 changes: 6 additions & 1 deletion docs/source/python-api/barrier.rst
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,9 @@ Clamped Log Squared Barrier
Cubic Barrier
~~~~~~~~~~~~~

.. autoclass:: ipctk.CubicBarrier
.. autoclass:: ipctk.CubicBarrier

Two-Stage Barrier
~~~~~~~~~~~~~~~~~

.. autoclass:: ipctk.TwoStageBarrier
10 changes: 10 additions & 0 deletions docs/source/references.bib
Original file line number Diff line number Diff line change
Expand Up @@ -108,3 +108,13 @@ @article{Huang2024GIPC
pages = {1--18},
note = {\url{https://dl.acm.org/doi/10.1145/3643028}}
}
@article{Chen2025Offset,
title = {Offset {Geometric} {Contact}},
author = {Chen, Anka He and Hsu, Jerry and Liu, Ziheng and Macklin, Miles and Yang, Yin and Yuksel, Cem},
year = 2025,
month = aug,
journal = {ACM Transactions on Graphics},
volume = 44,
number = 4,
note = {\url{https://ankachan.github.io/Projects/OGC/index.html}}
}
12 changes: 7 additions & 5 deletions docs/source/tutorials/convergent.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Convergent Formulation

In addition to the original implementation of :cite:t:`Li2020IPC`, we also implement the convergent formulation of :cite:t:`Li2023Convergent`.

Fully enabling the convergent formulation requires to set three flags: ``use_area_weighting`` and ``use_improved_max_approximator`` in ``Collisions`` (before calling ``build``) and ``use_physical_barrier`` in ``BarrierPotential``.
Fully enabling the convergent formulation requires to set three things: ``use_area_weighting`` and ``collision_set_type`` in ``Collisions`` (before calling ``build``) and ``use_physical_barrier`` in ``BarrierPotential``.

.. md-tab-set::

Expand All @@ -14,7 +14,8 @@ Fully enabling the convergent formulation requires to set three flags: ``use_are
.. code-block:: c++

collisions.set_use_area_weighting(true);
collisions.set_use_improved_max_approximator(true);
collisions.set_collision_set_type(
ipc::NormalCollisions::CollisionSetType::IMPROVED_MAX_APPROX);
collisions.build(collision_mesh, vertices, dhat);

barrier_potential.set_use_physical_barrier(true);
Expand All @@ -25,14 +26,15 @@ Fully enabling the convergent formulation requires to set three flags: ``use_are
.. code-block:: python

collisions.use_area_weighting = True
collisions.use_improved_max_approximator = True
collisions.collision_set_type = \
ipctk.NormalCollisions.CollisionSetType.IMPROVED_MAX_APPROX
collisions.build(collision_mesh, vertices, dhat)

barrier_potential.use_physical_barrier = True
b = barrier_potential(collisions, mesh, vertices);

.. important::
The flags ``use_area_weighting`` and ``use_improved_max_approximator`` should be set before calling ``build`` for them to take effect. By default, they are ``false``.
The members ``use_area_weighting`` and ``collision_set_type`` should be set before calling ``build`` for them to take effect. By default, they are ``false`` and ``IPC``.

Technical Details
-----------------
Expand Down Expand Up @@ -84,7 +86,7 @@ where :math:`V_{\text{int}} \subseteq V` is the subset of internal surface nodes
Comparison of the improved max approximator (right) to and exact max (left) and the direct summation (middle). For obtuse angles, the improved max approximator is tight, while for acute angles it might overestimate the max in concave regions.

.. tip::
The improved max approximator is enabled by setting ``use_improved_max_approximator`` to ``true`` in ``Collisions``.
The improved max approximator is enabled by setting ``collision_set_type`` to ``IMPROVED_MAX_APPROX`` in ``Collisions``.

The corresponding discrete barrier potential is then simply

Expand Down
Loading