Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
c81799b
Add initilisation of the advance anisotropic friction
antoinebou12 Jan 26, 2026
b711166
fix notebook
antoinebou12 Jan 26, 2026
238f64d
Merge branch 'main' into anisotropic_friction
Jan 27, 2026
daa4967
fix clang
Jan 27, 2026
7da5f45
Minor formatting improvements in test_anisotropic_friction.cpp for be…
Jan 27, 2026
044d520
Refactor anisotropic_mu_eff_dtau function to ensure finite results by…
Jan 27, 2026
822c7ed
Add anisotropic friction example script
Jan 27, 2026
ea6f654
remove example
Jan 27, 2026
2ead2c0
Refactor anisotropic_mu_eff_derivatives function to compute gradients…
Jan 27, 2026
2b759e4
Refactor anisotropic friction functions to unify naming conventions a…
Jan 27, 2026
cff3dbb
Refactor test cases in anisotropic friction tests for improved readab…
Jan 27, 2026
9b925ff
Refactor anisotropic friction notebook and tests for improved clarity…
antoinebou12 Jan 27, 2026
785d68c
Refactor anisotropic friction documentation and tests for clarity. Re…
antoinebou12 Jan 28, 2026
b5d6a6d
Add anisotropic friction model and documentation updates
Feb 4, 2026
cbbed82
Merge branch 'anisotropic_friction' of https://github.com/antoinebou1…
Feb 4, 2026
a9eef3a
Improvement to the quality clang and missing M_PI
Feb 4, 2026
40d2cdd
Update style guide and tools documentation for clang-format usage; im…
Feb 4, 2026
63e723b
Add missing tests no_contact_force_multiplier and edge cases
Feb 5, 2026
4ff3dc2
Fix clang and pipeine issues
Feb 5, 2026
2519f02
Update tests/src/tests/friction/test_force_jacobian.cpp
zfergus Feb 6, 2026
d8d466c
Update tests/src/tests/potential/test_friction_potential.cpp
zfergus Feb 6, 2026
0dcf561
Update tests/src/tests/friction/test_force_jacobian.cpp
zfergus Feb 6, 2026
b28d7e9
Fix formatting
zfergus Feb 6, 2026
5140c4a
Merge branch 'main' into anisotropic_friction
zfergus Feb 6, 2026
32acee0
Inline simple math function
zfergus Feb 6, 2026
adc9626
Refactor hessian method to avoid redundant anisotropic scaling calcul…
zfergus Feb 6, 2026
3b74176
Anisotropic friction handling by refining effective coefficient calcu…
Feb 10, 2026
e899d79
Fix merge requests
Feb 10, 2026
a88ac11
Merge main into anisotropic_friction; resolve test_force_jacobian con…
Feb 10, 2026
011132a
Clang format and comments
Feb 11, 2026
9bdb441
Fix build issues
Feb 11, 2026
1fc71c4
missing param
Feb 11, 2026
4a24adf
tangential velocity impact on friction force calculations.
Feb 11, 2026
d5ca5a0
Merge branch 'main' into anisotropic_friction
zfergus Feb 22, 2026
f36fd3b
Update docs
zfergus Feb 22, 2026
800e138
Refactor anisotropic friction handling in tangential potential
zfergus Feb 22, 2026
2bcb988
Merge branch 'main' into anisotropic_friction
zfergus Feb 22, 2026
22bde96
Add anisotropic mu gradient support to tangential
zfergus Feb 22, 2026
b0cbc89
Check gradient is -force in anisotropic test
zfergus Feb 22, 2026
06e48f7
Merge branch 'main' into anisotropic_friction
zfergus Mar 1, 2026
42b9946
Merge origin/main into anisotropic_friction; resolve test_force_jacob…
Apr 13, 2026
c0e2320
Anisotropic friction: lagged matchstick mu, API, tests, and docs
Apr 13, 2026
2bc622c
Merge branch 'anisotropic_friction' of https://github.com/antoinebou1…
Apr 13, 2026
aa028ba
Merge upstream/ipc-sim main; resolve references.bib (Erleben + main e…
Apr 13, 2026
92a66ea
Refactor anisotropic friction API and documentation
Apr 13, 2026
5def3c2
Refactor friction test cases for improved readability
Apr 13, 2026
d4b8063
Clang Format
Apr 13, 2026
0430354
Updated test cases to ensure consistency with the refactored code.
Apr 13, 2026
1dedbf5
Only lagged mode
Apr 13, 2026
55a1367
Small changes in docs and formating
Apr 15, 2026
ee1b1b3
anisotropic friction tests for numerical stability
Apr 15, 2026
2fec756
small fixes clang
Apr 15, 2026
483bba6
Changes based on the copilot review
Apr 15, 2026
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
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -514,7 +514,7 @@ __pycache__/

# Distribution / packaging
.Python
build/
build*/
develop-eggs/
dist/
downloads/
Expand Down
35 changes: 34 additions & 1 deletion docs/source/cpp-api/friction.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
Friction
========

.. seealso::

:doc:`/tutorials/advanced_friction` explains the friction model, the
static/kinetic transition, and anisotropic usage. Full derivation and
plots are in ``notebooks/anisotropic_friction_math.ipynb``.

Smooth Mollifier
----------------

Expand All @@ -20,4 +26,31 @@ Smooth :math:`\mu`
.. doxygenfunction:: smooth_mu_f1
.. doxygenfunction:: smooth_mu_f2
.. doxygenfunction:: smooth_mu_f1_over_x
.. doxygenfunction:: smooth_mu_f2_x_minus_mu_f1_over_x3
.. doxygenfunction:: smooth_mu_f2_x_minus_mu_f1_over_x3

Anisotropic Friction Helpers
-----------------------------

Effective friction follows an elliptical :math:`L^2` projection (matchstick cone):

.. math:: \mu_{\text{eff}} = \sqrt{(\mu_0 t_0)^2 + (\mu_1 t_1)^2}

with :math:`t = \tau / \|\tau\|`.

- Use ``anisotropic_mu_eff_from_tau_aniso`` when you have :math:`\tau_{\text{aniso}}` and need :math:`\mu_s`, :math:`\mu_k` for the smooth transition;
- use ``anisotropic_mu_eff_f`` when you have the unit direction.
- Zero ``mu_s_aniso`` and ``mu_k_aniso`` falls back to scalar :math:`\mu_s`, :math:`\mu_k`.

For tangential collision evaluation, effective directional coefficients are used
as lagged scalars (stored on each collision), i.e., no in-evaluation
:math:`\partial \mu_{\text{eff}} / \partial \tau` terms are taken in the force
or Jacobian/Hessian paths. Call
``TangentialCollisions::update_lagged_anisotropic_friction_coefficients(...)``
after ``build(...)`` and whenever lagged geometry/velocities used for slip are
updated (typically each Newton iteration).

See :cite:t:`Erleben2019Matchstick` for the Matchstick model; code: `erleben/matchstick <https://github.com/erleben/matchstick>`_.

.. doxygenfunction:: anisotropic_mu_eff_f
.. doxygenfunction:: anisotropic_x_from_tau_aniso
.. doxygenfunction:: anisotropic_mu_eff_from_tau_aniso
5 changes: 5 additions & 0 deletions docs/source/developers/style_guide.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ Code Formatting

We utilize `ClangFormat <https://clang.llvm.org/docs/ClangFormat.html>`_ to automate code formatting. Please format your code before pushing and/or creating a pull request.

- The project uses the root ``.clang-format`` (80 columns, WebKit-based).
- Under ``tests/``, ``tests/.clang-format`` inherits that style and sets ``SortIncludes: false``.
- CI runs ClangFormat version 20; format with the same version locally to avoid formatting check failures (e.g. ``clang-format -i`` using version 20, or use the pre-commit hook from :doc:`tools`).
- clang-tidy uses the same style via ``FormatStyle: file`` (see ``.clang-tidy``).

Additionally, ensure that your code adheres to the project's linting rules. Use the provided linting tools to check for any issues before committing your changes.

Naming conventions
Expand Down
2 changes: 1 addition & 1 deletion docs/source/developers/tools.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Tools for Developers
Using Pre-Commit Hooks
----------------------

Use the ``.pre-commit-config.yaml`` file to apply clang-format on before commits.
Use the ``.pre-commit-config.yaml`` file to apply ClangFormat before commits. Use ClangFormat version 20 (see :doc:`style_guide`).

Steps:

Expand Down
20 changes: 19 additions & 1 deletion docs/source/python-api/friction.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
Friction
========

.. seealso::

:doc:`/tutorials/advanced_friction` describes the friction model and
anisotropic usage. Additional anisotropic helpers are in :doc:`/cpp-api/friction`.

Smooth Mollifier
----------------

Expand All @@ -19,4 +24,17 @@ Smooth :math:`\mu`
.. autofunction:: ipctk.smooth_mu_f1
.. autofunction:: ipctk.smooth_mu_f2
.. autofunction:: ipctk.smooth_mu_f1_over_x
.. autofunction:: ipctk.smooth_mu_f2_x_minus_mu_f1_over_x3
.. autofunction:: ipctk.smooth_mu_f2_x_minus_mu_f1_over_x3

Anisotropic Friction Helpers
-----------------------------

``anisotropic_mu_eff_f`` implements the elliptical :math:`L^2` (matchstick)
effective-μ formula (:cite:t:`Erleben2019Matchstick`). The C++ API provides
``anisotropic_mu_eff_from_tau_aniso`` and related helpers. For
direction-dependent ellipse axes on tangential collisions, call
``TangentialCollisions.update_lagged_anisotropic_friction_coefficients`` so
effective μ matches the lagged slip direction; the built-in friction paths then
use those lagged scalars (they do not differentiate μ with respect to slip).

.. autofunction:: ipctk.anisotropic_mu_eff_f
13 changes: 12 additions & 1 deletion docs/source/references.bib
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,17 @@ @inproceedings{Cohen1995ICOLLIDE
address = {New York, NY, USA},
doi = {10.1145/199404.199437}
}
@article{Erleben2019Matchstick,
title = {The Matchstick Model for Anisotropic Friction Cones},
author = {Erleben, K. and Macklin, M. and Andrews, S. and Kry, P. G.},
year = 2019,
journal = {Computer Graphics Forum},
volume = 38,
number = 8,
pages = {1--12},
doi = {10.1111/cgf.13885},
note = {\url{https://github.com/erleben/matchstick}}
}
@inproceedings{Andrus2025Adopting,
author = {Andrus, Curtis},
title = {Adopting Research in Production at Netflix Animation Studios},
Expand Down Expand Up @@ -228,7 +239,7 @@ @article{Vidulis2023MultistableElasticKnots
number = {4},
issn = {0730-0301},
doi = {10.1145/3592399},
journal = {{ACM} Transactions on Graphics)},
journal = {{ACM} Transactions on Graphics},
month = jul,
articleno = {73},
numpages = {16},
Expand Down
Loading
Loading