From 99227308aed536d7abc39e5b2a7b982771ab1b2d Mon Sep 17 00:00:00 2001 From: Zachary Ferguson Date: Sun, 13 Jul 2025 17:08:51 -0400 Subject: [PATCH 1/2] Refactor and clean-up C++ API docs --- docs/Makefile | 5 +- docs/source/_static/css/custom.css | 5 ++ docs/source/{ => about}/dependencies.rst | 0 docs/source/{ => about}/license.rst | 2 +- docs/source/{ => about}/release_notes.rst | 0 docs/source/{ => building}/building.rst | 0 docs/source/{ => building}/python.rst | 2 +- docs/source/code_of_conduct.rst | 2 - docs/source/conf.py | 6 +- docs/source/contributing.rst | 2 - docs/source/cpp-api/adhesion.rst | 41 ++++++++-- docs/source/cpp-api/barrier.rst | 53 ------------ docs/source/cpp-api/barrier/Barrier.rst | 5 ++ .../cpp-api/barrier/ClampedLogBarrier.rst | 5 ++ .../cpp-api/barrier/ClampedLogSqBarrier.rst | 5 ++ docs/source/cpp-api/barrier/CubicBarrier.rst | 5 ++ .../cpp-api/barrier/NormalizedBarrier.rst | 5 ++ docs/source/cpp-api/barrier/index.rst | 82 +++++++++++++++++++ docs/source/cpp-api/potentials.rst | 44 ---------- .../cpp-api/potentials/BarrierPotential.rst | 4 + .../cpp-api/potentials/FrictionPotential.rst | 4 + .../potentials/NormalAdhesionPotential.rst | 4 + .../cpp-api/potentials/NormalPotential.rst | 4 + docs/source/cpp-api/potentials/Potential.rst | 4 + .../TangentialAdhesionPotential.rst | 4 + .../potentials/TangentialPotential.rst | 4 + docs/source/cpp-api/potentials/index.rst | 39 +++++++++ docs/source/cpp-api/utils.rst | 8 +- docs/source/developers/code_of_conduct.rst | 2 + docs/source/developers/contributing.rst | 2 + docs/source/{ => developers}/style_guide.rst | 0 docs/source/index.rst | 52 ++++++------ .../potentials/normal_adhesion_potential.cpp | 2 +- .../tangential_adhesion_potential.cpp | 2 +- src/ipc/adhesion/adhesion.hpp | 8 ++ src/ipc/barrier/adaptive_stiffness.hpp | 4 +- src/ipc/barrier/barrier.hpp | 2 +- src/ipc/broad_phase/broad_phase.hpp | 1 + src/ipc/broad_phase/brute_force.hpp | 1 + src/ipc/broad_phase/bvh.hpp | 1 + src/ipc/broad_phase/hash_grid.hpp | 1 + src/ipc/broad_phase/spatial_hash.hpp | 1 + src/ipc/broad_phase/sweep_and_prune.hpp | 1 + .../broad_phase/sweep_and_tiniest_queue.hpp | 1 + src/ipc/broad_phase/voxel_size_heuristic.hpp | 30 +++++++ src/ipc/candidates/candidates.hpp | 1 + src/ipc/candidates/collision_stencil.hpp | 2 +- src/ipc/candidates/edge_edge.hpp | 1 + src/ipc/candidates/edge_vertex.hpp | 1 + src/ipc/candidates/face_vertex.hpp | 1 + src/ipc/candidates/vertex_vertex.hpp | 1 + src/ipc/ccd/inexact_ccd.hpp | 1 + src/ipc/ccd/narrow_phase_ccd.hpp | 1 + src/ipc/ccd/nonlinear_ccd.hpp | 6 +- src/ipc/ccd/tight_inclusion_ccd.hpp | 1 + src/ipc/collisions/normal/plane_vertex.hpp | 2 +- src/ipc/potentials/normal_potential.hpp | 2 +- src/ipc/utils/eigen_ext.hpp | 32 +++++++- src/ipc/utils/interval.hpp | 5 ++ src/ipc/utils/unordered_map_and_set.hpp | 2 +- 60 files changed, 360 insertions(+), 154 deletions(-) rename docs/source/{ => about}/dependencies.rst (100%) rename docs/source/{ => about}/license.rst (96%) rename docs/source/{ => about}/release_notes.rst (100%) rename docs/source/{ => building}/building.rst (100%) rename docs/source/{ => building}/python.rst (68%) delete mode 100644 docs/source/code_of_conduct.rst delete mode 100644 docs/source/contributing.rst delete mode 100644 docs/source/cpp-api/barrier.rst create mode 100644 docs/source/cpp-api/barrier/Barrier.rst create mode 100644 docs/source/cpp-api/barrier/ClampedLogBarrier.rst create mode 100644 docs/source/cpp-api/barrier/ClampedLogSqBarrier.rst create mode 100644 docs/source/cpp-api/barrier/CubicBarrier.rst create mode 100644 docs/source/cpp-api/barrier/NormalizedBarrier.rst create mode 100644 docs/source/cpp-api/barrier/index.rst delete mode 100644 docs/source/cpp-api/potentials.rst create mode 100644 docs/source/cpp-api/potentials/BarrierPotential.rst create mode 100644 docs/source/cpp-api/potentials/FrictionPotential.rst create mode 100644 docs/source/cpp-api/potentials/NormalAdhesionPotential.rst create mode 100644 docs/source/cpp-api/potentials/NormalPotential.rst create mode 100644 docs/source/cpp-api/potentials/Potential.rst create mode 100644 docs/source/cpp-api/potentials/TangentialAdhesionPotential.rst create mode 100644 docs/source/cpp-api/potentials/TangentialPotential.rst create mode 100644 docs/source/cpp-api/potentials/index.rst create mode 100644 docs/source/developers/code_of_conduct.rst create mode 100644 docs/source/developers/contributing.rst rename docs/source/{ => developers}/style_guide.rst (100%) diff --git a/docs/Makefile b/docs/Makefile index e2d3e2e93..39df4988c 100644 --- a/docs/Makefile +++ b/docs/Makefile @@ -23,5 +23,8 @@ clean: %: Makefile @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) +xml: + cd "$(SOURCEDIR)" && doxygen Doxyfile + livehtml: - sphinx-autobuild --host 0.0.0.0 "$(SOURCEDIR)" "$(BUILDDIR)/html" $(SPHINXOPTS) $(O) + sphinx-autobuild --host 0.0.0.0 --port 8001 -j auto -a -q "$(SOURCEDIR)" "$(BUILDDIR)/html" $(SPHINXOPTS) $(O) diff --git a/docs/source/_static/css/custom.css b/docs/source/_static/css/custom.css index db1434c47..9b91a46d9 100644 --- a/docs/source/_static/css/custom.css +++ b/docs/source/_static/css/custom.css @@ -17,6 +17,10 @@ span.colon { margin-left: -1em; } +dl.cpp { + font-size: 0.64rem; +} + dl.cpp.objdesc, dl.py.objdesc { /* border: 0.05rem solid var(--md-primary-fg-color); */ @@ -28,6 +32,7 @@ dl.py.objdesc { dl.cpp.objdesc>dt, dl.py.objdesc>dt { + font-size: 0.64rem; padding-left: 0.5rem; padding-right: 0.5rem; } diff --git a/docs/source/dependencies.rst b/docs/source/about/dependencies.rst similarity index 100% rename from docs/source/dependencies.rst rename to docs/source/about/dependencies.rst diff --git a/docs/source/license.rst b/docs/source/about/license.rst similarity index 96% rename from docs/source/license.rst rename to docs/source/about/license.rst index afcb84c36..17be76f35 100644 --- a/docs/source/license.rst +++ b/docs/source/about/license.rst @@ -4,7 +4,7 @@ License IPC Toolkit is released under an MIT license, and all of its dependencies are under similar permissive licenses (MIT, Apache, or MPL). -.. literalinclude:: ../../LICENSE +.. literalinclude:: ../../../LICENSE :language: md Citation diff --git a/docs/source/release_notes.rst b/docs/source/about/release_notes.rst similarity index 100% rename from docs/source/release_notes.rst rename to docs/source/about/release_notes.rst diff --git a/docs/source/building.rst b/docs/source/building/building.rst similarity index 100% rename from docs/source/building.rst rename to docs/source/building/building.rst diff --git a/docs/source/python.rst b/docs/source/building/python.rst similarity index 68% rename from docs/source/python.rst rename to docs/source/building/python.rst index 27001e0f0..6ffef0e85 100644 --- a/docs/source/python.rst +++ b/docs/source/building/python.rst @@ -1,6 +1,6 @@ Python Bindings =============== -.. include:: ../../python/README.md +.. include:: ../../../python/README.md :parser: myst_parser.sphinx_ :start-line: 10 diff --git a/docs/source/code_of_conduct.rst b/docs/source/code_of_conduct.rst deleted file mode 100644 index f6ba82411..000000000 --- a/docs/source/code_of_conduct.rst +++ /dev/null @@ -1,2 +0,0 @@ -.. include:: ../CODE_OF_CONDUCT.md - :parser: myst_parser.sphinx_ \ No newline at end of file diff --git a/docs/source/conf.py b/docs/source/conf.py index 65103347d..c8627096f 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -101,7 +101,7 @@ "private-members", ) breathe_show_define_initializer = True -# breathe_show_include = True +breathe_show_include = True autodoc_default_options = { "members": True, @@ -176,14 +176,14 @@ "icon": {"repo": "fontawesome/brands/github"}, "features": [ - "navigation.expand", + "content.tabs.link", + "navigation.footer", "navigation.tabs", "navigation.top", "navigation.tracking", "search.highlight", "search.share", "toc.follow", - "content.tabs.link" ], "font": { diff --git a/docs/source/contributing.rst b/docs/source/contributing.rst deleted file mode 100644 index d1b6e78cb..000000000 --- a/docs/source/contributing.rst +++ /dev/null @@ -1,2 +0,0 @@ -.. include:: ../CONTRIBUTING.md - :parser: myst_parser.sphinx_ \ No newline at end of file diff --git a/docs/source/cpp-api/adhesion.rst b/docs/source/cpp-api/adhesion.rst index 0f6337176..7bfecb3c7 100644 --- a/docs/source/cpp-api/adhesion.rst +++ b/docs/source/cpp-api/adhesion.rst @@ -1,19 +1,42 @@ Adhesion ======== +Functions +--------- + +.. list-table:: + :header-rows: 1 + + * - Name + - Description + * - :func:`normal_adhesion_potential` + - The normal adhesion potential. + * - :func:`normal_adhesion_potential_first_derivative` + - The first derivative of the normal adhesion potential wrt d. + * - :func:`normal_adhesion_potential_second_derivative` + - The second derivative of the normal adhesion potential wrt d. + * - :func:`max_normal_adhesion_force_magnitude` + - The maximum normal adhesion force magnitude. + * - :func:`tangential_adhesion_f0` + - The tangential adhesion mollifier function. + * - :func:`tangential_adhesion_f1` + - The first derivative of the tangential adhesion mollifier function. + * - :func:`tangential_adhesion_f2` + - The second derivative of the tangential adhesion mollifier function. + * - :func:`tangential_adhesion_f1_over_x` + - The first derivative of the tangential adhesion mollifier function divided by y. + * - :func:`tangential_adhesion_f2_x_minus_f1_over_x3` + - The second derivative of the tangential adhesion mollifier function times y minus the first derivative all divided by y cubed. + + Normal Adhesion Potential ------------------------- -.. doxygenfunction:: normal_adhesion_potential -.. doxygenfunction:: normal_adhesion_potential_first_derivative -.. doxygenfunction:: normal_adhesion_potential_second_derivative -.. doxygenfunction:: max_normal_adhesion_force_magnitude +.. doxygengroup:: normal_adhesion + :content-only: Tangential Adhesion Potential ----------------------------- -.. doxygenfunction:: tangential_adhesion_f0 -.. doxygenfunction:: tangential_adhesion_f1 -.. doxygenfunction:: tangential_adhesion_f2 -.. doxygenfunction:: tangential_adhesion_f1_over_x -.. doxygenfunction:: tangential_adhesion_f2_x_minus_f1_over_x3 \ No newline at end of file +.. doxygengroup:: tangential_adhesion + :content-only: \ No newline at end of file diff --git a/docs/source/cpp-api/barrier.rst b/docs/source/cpp-api/barrier.rst deleted file mode 100644 index 99dadc633..000000000 --- a/docs/source/cpp-api/barrier.rst +++ /dev/null @@ -1,53 +0,0 @@ -Barrier -======= - -.. doxygenfunction:: barrier(const double, const double) -.. doxygenfunction:: barrier_first_derivative -.. doxygenfunction:: barrier_second_derivative - -Barrier Force Magnitude ------------------------ - -.. doxygenfunction:: barrier_force_magnitude -.. doxygenfunction:: barrier_force_magnitude_gradient - -Adaptive Barrier Stiffness --------------------------- - -.. doxygenfunction:: ipc::initial_barrier_stiffness -.. doxygenfunction:: ipc::update_barrier_stiffness - -Semi-Implicit Stiffness -~~~~~~~~~~~~~~~~~~~~~~~ - -.. doxygenfunction:: ipc::semi_implicit_stiffness(const CollisionMesh&, Eigen::ConstRef, const StencilsT&, Eigen::ConstRef, const Eigen::SparseMatrix&, const double) - -Barrier Class -------------- - -.. doxygenclass:: ipc::Barrier - :allow-dot-graphs: - -Clamped Log Barrier -~~~~~~~~~~~~~~~~~~~ - -.. doxygenclass:: ipc::ClampedLogBarrier - :allow-dot-graphs: - -Normalized Barrier -~~~~~~~~~~~~~~~~~~ - -.. doxygenclass:: ipc::NormalizedBarrier - :allow-dot-graphs: - -Clamped Log Squared Barrier -~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -.. doxygenclass:: ipc::ClampedLogSqBarrier - :allow-dot-graphs: - -Cubic Barrier -~~~~~~~~~~~~~ - -.. doxygenclass:: ipc::CubicBarrier - :allow-dot-graphs: \ No newline at end of file diff --git a/docs/source/cpp-api/barrier/Barrier.rst b/docs/source/cpp-api/barrier/Barrier.rst new file mode 100644 index 000000000..599ab5db3 --- /dev/null +++ b/docs/source/cpp-api/barrier/Barrier.rst @@ -0,0 +1,5 @@ +Barrier +======= + +.. doxygenclass:: ipc::Barrier + :allow-dot-graphs: \ No newline at end of file diff --git a/docs/source/cpp-api/barrier/ClampedLogBarrier.rst b/docs/source/cpp-api/barrier/ClampedLogBarrier.rst new file mode 100644 index 000000000..2a9a40512 --- /dev/null +++ b/docs/source/cpp-api/barrier/ClampedLogBarrier.rst @@ -0,0 +1,5 @@ +ClampedLogBarrier +================= + +.. doxygenclass:: ipc::ClampedLogBarrier + :allow-dot-graphs: \ No newline at end of file diff --git a/docs/source/cpp-api/barrier/ClampedLogSqBarrier.rst b/docs/source/cpp-api/barrier/ClampedLogSqBarrier.rst new file mode 100644 index 000000000..d844b422e --- /dev/null +++ b/docs/source/cpp-api/barrier/ClampedLogSqBarrier.rst @@ -0,0 +1,5 @@ +ClampedLogSqBarrier +=================== + +.. doxygenclass:: ipc::ClampedLogSqBarrier + :allow-dot-graphs: \ No newline at end of file diff --git a/docs/source/cpp-api/barrier/CubicBarrier.rst b/docs/source/cpp-api/barrier/CubicBarrier.rst new file mode 100644 index 000000000..a5e975b4d --- /dev/null +++ b/docs/source/cpp-api/barrier/CubicBarrier.rst @@ -0,0 +1,5 @@ +CubicBarrier +============ + +.. doxygenclass:: ipc::CubicBarrier + :allow-dot-graphs: \ No newline at end of file diff --git a/docs/source/cpp-api/barrier/NormalizedBarrier.rst b/docs/source/cpp-api/barrier/NormalizedBarrier.rst new file mode 100644 index 000000000..f80541134 --- /dev/null +++ b/docs/source/cpp-api/barrier/NormalizedBarrier.rst @@ -0,0 +1,5 @@ +NormalizedBarrier +============ + +.. doxygenclass:: ipc::NormalizedBarrier + :allow-dot-graphs: \ No newline at end of file diff --git a/docs/source/cpp-api/barrier/index.rst b/docs/source/cpp-api/barrier/index.rst new file mode 100644 index 000000000..224a43bd3 --- /dev/null +++ b/docs/source/cpp-api/barrier/index.rst @@ -0,0 +1,82 @@ +Barrier +======= + +.. toctree:: + :caption: Barrier + :hidden: + + Barrier.rst + ClampedLogBarrier.rst + NormalizedBarrier.rst + ClampedLogSqBarrier.rst + CubicBarrier.rst + +Barrier functions and functionals. + +Types +----- + +.. list-table:: + :header-rows: 1 + + * - Name + - Description + * - :doc:`Barrier ` + - Base class for barrier functions. + * - :doc:`ClampedLogBarrier ` + - Smoothly clamped log barrier functions from [Li et al.]. + * - :doc:`ClampedLogSqBarrier ` + - Clamped log barrier with a quadratic log term from [Huang et al.]. + * - :doc:`CubicBarrier ` + - Cubic barrier function from [Ando 2024]. + * - :doc:`NormalizedBarrier ` + - Normalized barrier function from [Li et al.]. + +Functions +--------- + +.. list-table:: + :header-rows: 1 + + * - Name + - Description + * - :func:`ipc::barrier` + - Evaluate the barrier function. + * - :func:`ipc::barrier_first_derivative` + - Derivative of the barrier function. + * - :func:`ipc::barrier_second_derivative` + - Second derivative of the barrier function. + * - :func:`ipc::barrier_force_magnitude` + - Compute the barrier force magnitude. + * - :func:`ipc::barrier_force_magnitude_gradient` + - Compute the gradient of the barrier force magnitude. + * - :func:`ipc::initial_barrier_stiffness` + - Compute the initial barrier stiffness. + * - :func:`ipc::update_barrier_stiffness` + - Update the barrier stiffness based on the current state. + * - :func:`ipc::semi_implicit_stiffness` + - Compute the semi-implicit stiffness for all collisions. + +Function Details +---------------- + +.. doxygenfunction:: barrier(const double, const double) +.. doxygenfunction:: barrier_first_derivative +.. doxygenfunction:: barrier_second_derivative + +Barrier Force Magnitude +~~~~~~~~~~~~~~~~~~~~~~~ + +.. doxygenfunction:: barrier_force_magnitude +.. doxygenfunction:: barrier_force_magnitude_gradient + +Adaptive Barrier Stiffness +~~~~~~~~~~~~~~~~~~~~~~~~~~ + +.. doxygenfunction:: initial_barrier_stiffness +.. doxygenfunction:: update_barrier_stiffness + +Semi-Implicit Stiffness +^^^^^^^^^^^^^^^^^^^^^^^ + +.. doxygenfunction:: semi_implicit_stiffness(const CollisionMesh&, Eigen::ConstRef, const StencilsT&, Eigen::ConstRef, const Eigen::SparseMatrix&, const double) diff --git a/docs/source/cpp-api/potentials.rst b/docs/source/cpp-api/potentials.rst deleted file mode 100644 index 3d0e1fce6..000000000 --- a/docs/source/cpp-api/potentials.rst +++ /dev/null @@ -1,44 +0,0 @@ -Potentials -========== - -Generic Potential ------------------ - -.. doxygenclass:: ipc::Potential - :allow-dot-graphs: - -Normal Potentials ------------------ - -.. doxygenclass:: ipc::NormalPotential - :allow-dot-graphs: - -Barrier Potential -^^^^^^^^^^^^^^^^^ - -.. doxygenclass:: ipc::BarrierPotential - :allow-dot-graphs: - -Normal Adhesion Potential -^^^^^^^^^^^^^^^^^^^^^^^^^ - -.. doxygenclass:: ipc::NormalAdhesionPotential - :allow-dot-graphs: - -Tangential Potentials ---------------------- - -.. doxygenclass:: ipc::TangentialPotential - :allow-dot-graphs: - -Friction Potential -^^^^^^^^^^^^^^^^^^ - -.. doxygenclass:: ipc::FrictionPotential - :allow-dot-graphs: - -Tangential Adhesion Potential -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -.. doxygenclass:: ipc::TangentialAdhesionPotential - :allow-dot-graphs: \ No newline at end of file diff --git a/docs/source/cpp-api/potentials/BarrierPotential.rst b/docs/source/cpp-api/potentials/BarrierPotential.rst new file mode 100644 index 000000000..0ea78976d --- /dev/null +++ b/docs/source/cpp-api/potentials/BarrierPotential.rst @@ -0,0 +1,4 @@ +BarrierPotential +================ + +.. doxygenclass:: ipc::BarrierPotential \ No newline at end of file diff --git a/docs/source/cpp-api/potentials/FrictionPotential.rst b/docs/source/cpp-api/potentials/FrictionPotential.rst new file mode 100644 index 000000000..010e1a423 --- /dev/null +++ b/docs/source/cpp-api/potentials/FrictionPotential.rst @@ -0,0 +1,4 @@ +FrictionPotential +================= + +.. doxygenclass:: ipc::FrictionPotential \ No newline at end of file diff --git a/docs/source/cpp-api/potentials/NormalAdhesionPotential.rst b/docs/source/cpp-api/potentials/NormalAdhesionPotential.rst new file mode 100644 index 000000000..79da8d068 --- /dev/null +++ b/docs/source/cpp-api/potentials/NormalAdhesionPotential.rst @@ -0,0 +1,4 @@ +NormalAdhesionPotential +======================== + +.. doxygenclass:: ipc::NormalAdhesionPotential \ No newline at end of file diff --git a/docs/source/cpp-api/potentials/NormalPotential.rst b/docs/source/cpp-api/potentials/NormalPotential.rst new file mode 100644 index 000000000..f1a65735f --- /dev/null +++ b/docs/source/cpp-api/potentials/NormalPotential.rst @@ -0,0 +1,4 @@ +NormalPotential +=============== + +.. doxygenclass:: ipc::NormalPotential \ No newline at end of file diff --git a/docs/source/cpp-api/potentials/Potential.rst b/docs/source/cpp-api/potentials/Potential.rst new file mode 100644 index 000000000..9249cc974 --- /dev/null +++ b/docs/source/cpp-api/potentials/Potential.rst @@ -0,0 +1,4 @@ +Potential +========== + +.. doxygenclass:: ipc::Potential \ No newline at end of file diff --git a/docs/source/cpp-api/potentials/TangentialAdhesionPotential.rst b/docs/source/cpp-api/potentials/TangentialAdhesionPotential.rst new file mode 100644 index 000000000..6250219e8 --- /dev/null +++ b/docs/source/cpp-api/potentials/TangentialAdhesionPotential.rst @@ -0,0 +1,4 @@ +TangentialAdhesionPotential +============================ + +.. doxygenclass:: ipc::TangentialAdhesionPotential diff --git a/docs/source/cpp-api/potentials/TangentialPotential.rst b/docs/source/cpp-api/potentials/TangentialPotential.rst new file mode 100644 index 000000000..cfaf098f7 --- /dev/null +++ b/docs/source/cpp-api/potentials/TangentialPotential.rst @@ -0,0 +1,4 @@ +TangentialPotential +=================== + +.. doxygenclass:: ipc::TangentialPotential diff --git a/docs/source/cpp-api/potentials/index.rst b/docs/source/cpp-api/potentials/index.rst new file mode 100644 index 000000000..591e2d1b5 --- /dev/null +++ b/docs/source/cpp-api/potentials/index.rst @@ -0,0 +1,39 @@ +Potentials +========== + +.. toctree:: + :caption: Potentials + :hidden: + + Potential.rst + NormalPotential.rst + BarrierPotential.rst + NormalAdhesionPotential.rst + TangentialPotential.rst + FrictionPotential.rst + TangentialAdhesionPotential.rst + +Incremental potential classes. + +Types +----- + +.. list-table:: + :header-rows: 1 + + * - Name + - Description + * - :doc:`Potential ` + - Base class for potentials. + * - :doc:`NormalPotential ` + - Base class for distance-based potentials. + * - :doc:`BarrierPotential ` + - The barrier collision potential. + * - :doc:`NormalAdhesionPotential ` + - The normal adhesion potential. + * - :doc:`TangentialPotential ` + - A tangential dissipative potential. + * - :doc:`FrictionPotential ` + - The friction dissipative potential. + * - :doc:`TangentialAdhesionPotential ` + - The tangential adhesion potential. \ No newline at end of file diff --git a/docs/source/cpp-api/utils.rst b/docs/source/cpp-api/utils.rst index 495a2b259..8d494bc4c 100644 --- a/docs/source/cpp-api/utils.rst +++ b/docs/source/cpp-api/utils.rst @@ -13,4 +13,10 @@ Positive Semi-Definite Projection .. doxygenfunction:: ipc::project_to_psd .. doxygenfunction:: ipc::project_to_pd -.. doxygenenum:: ipc::PSDProjectionMethod \ No newline at end of file +.. doxygenenum:: ipc::PSDProjectionMethod + +Eigen Extensions +---------------- + +.. doxygengroup:: eigen_ext + :content-only: \ No newline at end of file diff --git a/docs/source/developers/code_of_conduct.rst b/docs/source/developers/code_of_conduct.rst new file mode 100644 index 000000000..94120616e --- /dev/null +++ b/docs/source/developers/code_of_conduct.rst @@ -0,0 +1,2 @@ +.. include:: ../../CODE_OF_CONDUCT.md + :parser: myst_parser.sphinx_ \ No newline at end of file diff --git a/docs/source/developers/contributing.rst b/docs/source/developers/contributing.rst new file mode 100644 index 000000000..e779ad338 --- /dev/null +++ b/docs/source/developers/contributing.rst @@ -0,0 +1,2 @@ +.. include:: ../../CONTRIBUTING.md + :parser: myst_parser.sphinx_ \ No newline at end of file diff --git a/docs/source/style_guide.rst b/docs/source/developers/style_guide.rst similarity index 100% rename from docs/source/style_guide.rst rename to docs/source/developers/style_guide.rst diff --git a/docs/source/index.rst b/docs/source/index.rst index bf797a644..dc62d3ade 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -3,16 +3,16 @@ :hidden: Home - release_notes.rst - license.rst - dependencies.rst + about/release_notes.rst + about/license.rst + about/dependencies.rst .. toctree:: :caption: Building :hidden: - Library - python.rst + Library + building/python.rst .. toctree:: :caption: Tutorial @@ -31,49 +31,49 @@ :caption: C++ API :hidden: - cpp-api/potentials.rst - cpp-api/collision_mesh.rst - cpp-api/candidates.rst - cpp-api/normal_collisions.rst - cpp-api/tangential_collisions.rst - cpp-api/friction.rst + cpp-api/adhesion.rst + cpp-api/barrier/index.rst cpp-api/broad_phase.rst + cpp-api/candidates.rst cpp-api/ccd.rst + cpp-api/collision_mesh.rst cpp-api/distance.rst - cpp-api/tangent.rst - cpp-api/barrier.rst - cpp-api/adhesion.rst + cpp-api/friction.rst cpp-api/intersections.rst cpp-api/interval.rst + cpp-api/normal_collisions.rst + cpp-api/potentials/index.rst + cpp-api/tangent.rst + cpp-api/tangential_collisions.rst cpp-api/utils.rst .. toctree:: :caption: Python API :hidden: - python-api/potentials.rst - python-api/collision_mesh.rst - python-api/candidates.rst - python-api/normal_collisions.rst - python-api/tangential_collisions.rst - python-api/friction.rst + python-api/adhesion.rst + python-api/barrier.rst python-api/broad_phase.rst + python-api/candidates.rst python-api/ccd.rst + python-api/collision_mesh.rst python-api/distance.rst - python-api/tangent.rst - python-api/barrier.rst - python-api/adhesion.rst + python-api/friction.rst python-api/intersections.rst python-api/interval.rst + python-api/normal_collisions.rst + python-api/potentials.rst + python-api/tangent.rst + python-api/tangential_collisions.rst python-api/utils.rst .. toctree:: :caption: Developers :hidden: - contributing - style_guide - Code of Conduct + developers/contributing.rst + developers/style_guide.rst + Code of Conduct .. image:: _static/logo.png :alt: IPC Toolkit diff --git a/python/src/potentials/normal_adhesion_potential.cpp b/python/src/potentials/normal_adhesion_potential.cpp index 13f76d988..7bbae6190 100644 --- a/python/src/potentials/normal_adhesion_potential.cpp +++ b/python/src/potentials/normal_adhesion_potential.cpp @@ -16,7 +16,7 @@ void define_normal_adhesion_potential(py::module_& m) "The distance of largest adhesion force (:math:`\\hat{d}_{p}`) (:math:`0 < \\hat{d}_{p} < \\hat{d}_{a}`).") .def_readwrite( "dhat_a", &NormalAdhesionPotential::dhat_a, - "The adhesion activation distance (:math:`\\hat{d}_{a}`.") + "The adhesion activation distance (:math:`\\hat{d}_{a}`).") .def_readwrite( "Y", &NormalAdhesionPotential::Y, "The Young's modulus (:math:`Y`)).") diff --git a/python/src/potentials/tangential_adhesion_potential.cpp b/python/src/potentials/tangential_adhesion_potential.cpp index 87113610d..e57bf3ab0 100644 --- a/python/src/potentials/tangential_adhesion_potential.cpp +++ b/python/src/potentials/tangential_adhesion_potential.cpp @@ -20,5 +20,5 @@ void define_tangential_adhesion_potential(py::module_& m) .def_property( "eps_a", &TangentialAdhesionPotential::eps_a, &TangentialAdhesionPotential::set_eps_a, - "Get the tangential adhesion mollifier parameter :math:`\epsilon_a`."); + "Get the tangential adhesion mollifier parameter :math:`\\epsilon_a`."); } diff --git a/src/ipc/adhesion/adhesion.hpp b/src/ipc/adhesion/adhesion.hpp index 6c92de656..1d1d75164 100644 --- a/src/ipc/adhesion/adhesion.hpp +++ b/src/ipc/adhesion/adhesion.hpp @@ -5,6 +5,8 @@ namespace ipc { // Fang and Li et al. [2023]: // -- Normal Adhesion ---------------------------------------------------------- +/// @defgroup normal_adhesion Normal Adhesion +/// @{ /// @brief The normal adhesion potential. /// @param d distance @@ -41,7 +43,11 @@ double normal_adhesion_potential_second_derivative( double max_normal_adhesion_force_magnitude( const double dhat_p, const double dhat_a, const double a2); +/// @} + // -- Tangential Adhesion ------------------------------------------------------ +/// @defgroup tangential_adhesion Tangential Adhesion +/// @{ /// @brief The tangential adhesion mollifier function. /// @param y The tangential relative speed. @@ -74,4 +80,6 @@ double tangential_adhesion_f1_over_x(const double y, const double eps_a); double tangential_adhesion_f2_x_minus_f1_over_x3(const double y, const double eps_a); +/// @} + } // namespace ipc diff --git a/src/ipc/barrier/adaptive_stiffness.hpp b/src/ipc/barrier/adaptive_stiffness.hpp index 8d70378cf..c1efdbcb6 100644 --- a/src/ipc/barrier/adaptive_stiffness.hpp +++ b/src/ipc/barrier/adaptive_stiffness.hpp @@ -51,7 +51,7 @@ double update_barrier_stiffness( const double dmin = 0); /// @brief Compute the semi-implicit stiffness for a single collision. -/// See [Ando 2024] for details. +/// @note See [Ando 2024] for details. /// @param stencil Collision stencil. /// @param vertices Vertex positions. /// @param mass Vertex masses. @@ -66,7 +66,7 @@ double semi_implicit_stiffness( const double dmin); /// @brief Compute the semi-implicit stiffness's for all collisions. -/// See [Ando 2024] for details. +/// @note See [Ando 2024] for details. /// @param mesh Collision mesh. /// @param vertices Vertex positions. /// @param collisions Normal collisions or collision candidates. diff --git a/src/ipc/barrier/barrier.hpp b/src/ipc/barrier/barrier.hpp index a83f48fef..8deffe17e 100644 --- a/src/ipc/barrier/barrier.hpp +++ b/src/ipc/barrier/barrier.hpp @@ -34,7 +34,7 @@ class Barrier { /// @brief Get the units of the barrier function. /// @param dhat The activation distance of the barrier. - /// @return + /// @return The units of the barrier function. virtual double units(const double dhat) const = 0; }; diff --git a/src/ipc/broad_phase/broad_phase.hpp b/src/ipc/broad_phase/broad_phase.hpp index 50cd91405..446e0f598 100644 --- a/src/ipc/broad_phase/broad_phase.hpp +++ b/src/ipc/broad_phase/broad_phase.hpp @@ -15,6 +15,7 @@ namespace ipc { class Candidates; // Forward declaration +/// @brief Base class for broad phase collision detection methods. class BroadPhase { public: virtual ~BroadPhase() { clear(); } diff --git a/src/ipc/broad_phase/brute_force.hpp b/src/ipc/broad_phase/brute_force.hpp index be97afcdb..56a0e4413 100644 --- a/src/ipc/broad_phase/brute_force.hpp +++ b/src/ipc/broad_phase/brute_force.hpp @@ -4,6 +4,7 @@ namespace ipc { +/// @brief Brute force broad phase collision detection. class BruteForce : public BroadPhase { public: BruteForce() = default; diff --git a/src/ipc/broad_phase/bvh.hpp b/src/ipc/broad_phase/bvh.hpp index 0d1291b19..dd3dc80f4 100644 --- a/src/ipc/broad_phase/bvh.hpp +++ b/src/ipc/broad_phase/bvh.hpp @@ -6,6 +6,7 @@ namespace ipc { +/// @brief Bounding Volume Hierarchy (BVH) broad phase collision detection. class BVH : public BroadPhase { public: BVH() = default; diff --git a/src/ipc/broad_phase/hash_grid.hpp b/src/ipc/broad_phase/hash_grid.hpp index b0c10d31c..823feabda 100644 --- a/src/ipc/broad_phase/hash_grid.hpp +++ b/src/ipc/broad_phase/hash_grid.hpp @@ -24,6 +24,7 @@ struct HashItem { } }; +/// @brief Hash grid broad phase collision detection. class HashGrid : public BroadPhase { public: HashGrid() = default; diff --git a/src/ipc/broad_phase/spatial_hash.hpp b/src/ipc/broad_phase/spatial_hash.hpp index d6d219c05..7b783d00f 100644 --- a/src/ipc/broad_phase/spatial_hash.hpp +++ b/src/ipc/broad_phase/spatial_hash.hpp @@ -10,6 +10,7 @@ namespace ipc { +/// @brief Spatial hash broad phase collision detection. class SpatialHash : public BroadPhase { public: // data /// @brief The left bottom corner of the world bounding box. diff --git a/src/ipc/broad_phase/sweep_and_prune.hpp b/src/ipc/broad_phase/sweep_and_prune.hpp index 253dff668..5750af199 100644 --- a/src/ipc/broad_phase/sweep_and_prune.hpp +++ b/src/ipc/broad_phase/sweep_and_prune.hpp @@ -6,6 +6,7 @@ namespace ipc { +/// @brief Sweep and Prune broad phase collision detection. class SweepAndPrune : public BroadPhase { public: SweepAndPrune() = default; diff --git a/src/ipc/broad_phase/sweep_and_tiniest_queue.hpp b/src/ipc/broad_phase/sweep_and_tiniest_queue.hpp index aeb7f5e32..5f62ffc8f 100644 --- a/src/ipc/broad_phase/sweep_and_tiniest_queue.hpp +++ b/src/ipc/broad_phase/sweep_and_tiniest_queue.hpp @@ -10,6 +10,7 @@ namespace ipc { +/// @brief Sweep and Tiniest Queue broad phase collision detection. class SweepAndTiniestQueue : public BroadPhase { public: SweepAndTiniestQueue() = default; diff --git a/src/ipc/broad_phase/voxel_size_heuristic.hpp b/src/ipc/broad_phase/voxel_size_heuristic.hpp index f62bb630b..a124ad39d 100644 --- a/src/ipc/broad_phase/voxel_size_heuristic.hpp +++ b/src/ipc/broad_phase/voxel_size_heuristic.hpp @@ -4,11 +4,22 @@ namespace ipc { +/// @brief Suggest a good voxel size for the given mesh. +/// @param vertices The vertex positions of the mesh. +/// @param edges The edges of the mesh. +/// @param inflation_radius The radius of inflation around all elements. +/// @return The suggested voxel size. double suggest_good_voxel_size( Eigen::ConstRef vertices, Eigen::ConstRef edges, const double inflation_radius = 0); +/// @brief Suggest a good voxel size for the given mesh. +/// @param vertices_t0 The vertex positions of the mesh at time t0. +/// @param vertices_t1 The vertex positions of the mesh at time t1. +/// @param edges The edges of the mesh. +/// @param inflation_radius The radius of inflation around all elements. +/// @return The suggested voxel size. double suggest_good_voxel_size( Eigen::ConstRef vertices_t0, Eigen::ConstRef vertices_t1, @@ -16,6 +27,11 @@ double suggest_good_voxel_size( const double inflation_radius = 0); /// @brief Compute the average edge length of a mesh. +/// @param vertices_t0 The vertex positions of the mesh at time t0. +/// @param vertices_t1 The vertex positions of the mesh at time t1. +/// @param edges The edges of the mesh. +/// @param[out] std_deviation The standard deviation of the edge lengths. +/// @return The average edge length. double mean_edge_length( Eigen::ConstRef vertices_t0, Eigen::ConstRef vertices_t1, @@ -23,26 +39,40 @@ double mean_edge_length( double& std_deviation); /// @brief Compute the average displacement length. +/// @param displacements The displacements of the vertices. +/// @param[out] std_deviation The standard deviation of the displacement lengths. +/// @return The average displacement length. double mean_displacement_length( Eigen::ConstRef displacements, double& std_deviation); /// @brief Compute the median edge length of a mesh. +/// @param vertices_t0 The vertex positions of the mesh at time t0. +/// @param vertices_t1 The vertex positions of the mesh at time t1. +/// @param edges The edges of the mesh. +/// @return The median edge length. double median_edge_length( Eigen::ConstRef vertices_t0, Eigen::ConstRef vertices_t1, Eigen::ConstRef edges); /// @brief Compute the median displacement length. +/// @param displacements The displacements of the vertices. double median_displacement_length(Eigen::ConstRef displacements); /// @brief Compute the maximum edge length of a mesh. +/// @param vertices_t0 The vertex positions of the mesh at time t0. +/// @param vertices_t1 The vertex positions of the mesh at time t1. +/// @param edges The edges of the mesh. +/// @return The maximum edge length. double max_edge_length( Eigen::ConstRef vertices_t0, Eigen::ConstRef vertices_t1, Eigen::ConstRef edges); /// @brief Compute the maximum displacement length. +/// @param displacements The displacements of the vertices. +/// @return The maximum displacement length. double max_displacement_length(Eigen::ConstRef displacements); } // namespace ipc diff --git a/src/ipc/candidates/candidates.hpp b/src/ipc/candidates/candidates.hpp index 76e863113..f1170dc47 100644 --- a/src/ipc/candidates/candidates.hpp +++ b/src/ipc/candidates/candidates.hpp @@ -12,6 +12,7 @@ namespace ipc { +/// @brief A class for storing and managing collision candidates. class Candidates { public: Candidates() = default; diff --git a/src/ipc/candidates/collision_stencil.hpp b/src/ipc/candidates/collision_stencil.hpp index c7b323134..9156c76fd 100644 --- a/src/ipc/candidates/collision_stencil.hpp +++ b/src/ipc/candidates/collision_stencil.hpp @@ -119,7 +119,7 @@ class CollisionStencil { return compute_distance_hessian(dof(vertices, edges, faces)); } - /// @brief Compute the coefficients of the stencil s.t. d(x) = ‖∑ cᵢ xᵢ‖². + /// @brief Compute the coefficients of the stencil s.t. \f$d(x) = \|\sum c_i \mathbf{x}_i\|^2\f$. /// @param vertices Collision mesh vertices /// @param edges Collision mesh edges /// @param faces Collision mesh faces diff --git a/src/ipc/candidates/edge_edge.hpp b/src/ipc/candidates/edge_edge.hpp index 61c843379..bc3ea0876 100644 --- a/src/ipc/candidates/edge_edge.hpp +++ b/src/ipc/candidates/edge_edge.hpp @@ -9,6 +9,7 @@ namespace ipc { +/// @brief A candidate for edge-edge collision detection. class EdgeEdgeCandidate : virtual public CollisionStencil { public: EdgeEdgeCandidate(index_t edge0_id, index_t edge1_id); diff --git a/src/ipc/candidates/edge_vertex.hpp b/src/ipc/candidates/edge_vertex.hpp index 2be02a3ba..cb06e73e8 100644 --- a/src/ipc/candidates/edge_vertex.hpp +++ b/src/ipc/candidates/edge_vertex.hpp @@ -9,6 +9,7 @@ namespace ipc { +/// @brief A candidate for edge-vertex collision detection. class EdgeVertexCandidate : virtual public CollisionStencil { public: EdgeVertexCandidate(index_t edge_id, index_t vertex_id); diff --git a/src/ipc/candidates/face_vertex.hpp b/src/ipc/candidates/face_vertex.hpp index b391823b4..13c59d78b 100644 --- a/src/ipc/candidates/face_vertex.hpp +++ b/src/ipc/candidates/face_vertex.hpp @@ -9,6 +9,7 @@ namespace ipc { +/// @brief A candidate for face-vertex collision detection. class FaceVertexCandidate : virtual public CollisionStencil { public: FaceVertexCandidate(index_t face_id, index_t vertex_id); diff --git a/src/ipc/candidates/vertex_vertex.hpp b/src/ipc/candidates/vertex_vertex.hpp index dff19d973..173647129 100644 --- a/src/ipc/candidates/vertex_vertex.hpp +++ b/src/ipc/candidates/vertex_vertex.hpp @@ -9,6 +9,7 @@ namespace ipc { +/// @brief A candidate for vertex-vertex collision detection. class VertexVertexCandidate : virtual public CollisionStencil { public: VertexVertexCandidate(index_t vertex0_id, index_t vertex1_id); diff --git a/src/ipc/ccd/inexact_ccd.hpp b/src/ipc/ccd/inexact_ccd.hpp index fb09de19d..6e0f085d3 100644 --- a/src/ipc/ccd/inexact_ccd.hpp +++ b/src/ipc/ccd/inexact_ccd.hpp @@ -8,6 +8,7 @@ namespace ipc { +/// @brief Inexact Continuous Collision Detection (CCD) class InexactCCD : public NarrowPhaseCCD { public: /// The default conservative rescaling value used to avoid taking steps diff --git a/src/ipc/ccd/narrow_phase_ccd.hpp b/src/ipc/ccd/narrow_phase_ccd.hpp index e36069c12..04c44441b 100644 --- a/src/ipc/ccd/narrow_phase_ccd.hpp +++ b/src/ipc/ccd/narrow_phase_ccd.hpp @@ -4,6 +4,7 @@ namespace ipc { +/// @brief Narrow Phase Continuous Collision Detection (CCD) interface. class NarrowPhaseCCD { public: NarrowPhaseCCD() = default; diff --git a/src/ipc/ccd/nonlinear_ccd.hpp b/src/ipc/ccd/nonlinear_ccd.hpp index 1c65c9354..3bc4a2eb2 100644 --- a/src/ipc/ccd/nonlinear_ccd.hpp +++ b/src/ipc/ccd/nonlinear_ccd.hpp @@ -34,12 +34,15 @@ class IntervalNonlinearTrajectory : virtual public NonlinearTrajectory { using NonlinearTrajectory::operator(); /// @brief Compute the point's position over a time interval t + /// @param[in] t The time interval + /// @return The point's position at time t as an interval virtual VectorMax3I operator()(const filib::Interval& t) const = 0; /// @brief Compute the maximum distance from the nonlinear trajectory to a linearized trajectory /// @note This uses interval arithmetic to compute the maximum distance. If you know a tighter bound on the maximum distance, it is recommended to override this function. /// @param[in] t0 Start time of the trajectory /// @param[in] t1 End time of the trajectory + /// @return The maximum distance from the nonlinear trajectory to a linearized trajectory virtual double max_distance_from_linear(const double t0, const double t1) const; }; @@ -90,6 +93,7 @@ bool point_edge_nonlinear_ccd( TightInclusionCCD::DEFAULT_CONSERVATIVE_RESCALING); /// @brief Perform nonlinear CCD between two linear edges moving along nonlinear trajectories. +/// @ingroup ccd /// @param[in] ea0 First edge's first endpoint's trajectory /// @param[in] ea1 First edge's second endpoint's trajectory /// @param[in] eb0 Second edge's first endpoint's trajectory @@ -147,7 +151,7 @@ bool point_triangle_nonlinear_ccd( /// @param[in] tmax Maximum time to check for collision. /// @param[in] min_distance Minimum separation distance between the objects. /// @param[in] conservative_rescaling Conservative rescaling of the time of impact. -/// @return +/// @return True if a collision was detected, false otherwise. bool conservative_piecewise_linear_ccd( const std::function& distance, const std::function& diff --git a/src/ipc/ccd/tight_inclusion_ccd.hpp b/src/ipc/ccd/tight_inclusion_ccd.hpp index 1fb572c6d..244141460 100644 --- a/src/ipc/ccd/tight_inclusion_ccd.hpp +++ b/src/ipc/ccd/tight_inclusion_ccd.hpp @@ -4,6 +4,7 @@ namespace ipc { +/// @brief Tight-Inclusion Continuous Collision Detection (CCD) algorithm. class TightInclusionCCD : public NarrowPhaseCCD { public: /// The default tolerance used with Tight-Inclusion CCD. diff --git a/src/ipc/collisions/normal/plane_vertex.hpp b/src/ipc/collisions/normal/plane_vertex.hpp index 2df51fc88..9dede7020 100644 --- a/src/ipc/collisions/normal/plane_vertex.hpp +++ b/src/ipc/collisions/normal/plane_vertex.hpp @@ -12,7 +12,7 @@ class PlaneVertexNormalCollision : public NormalCollision { Eigen::ConstRef plane_normal, const index_t vertex_id); - int num_vertices() const override { return 1; }; + int num_vertices() const override { return 1; } std::array vertex_ids( Eigen::ConstRef edges, diff --git a/src/ipc/potentials/normal_potential.hpp b/src/ipc/potentials/normal_potential.hpp index 22f8c4ef6..a4eb8ee0c 100644 --- a/src/ipc/potentials/normal_potential.hpp +++ b/src/ipc/potentials/normal_potential.hpp @@ -25,7 +25,7 @@ class NormalPotential : public Potential { /// @param collisions The set of collisions. /// @param mesh The collision mesh. /// @param vertices Vertices of the collision mesh. - /// @throws std::runtime_error If the collision collisions were not built with shape derivatives enabled. + /// @throw std::runtime_error If the collision collisions were not built with shape derivatives enabled. /// @returns The derivative of the force with respect to X, the rest vertices. Eigen::SparseMatrix shape_derivative( const NormalCollisions& collisions, diff --git a/src/ipc/utils/eigen_ext.hpp b/src/ipc/utils/eigen_ext.hpp index bf0698245..99521641c 100644 --- a/src/ipc/utils/eigen_ext.hpp +++ b/src/ipc/utils/eigen_ext.hpp @@ -13,23 +13,48 @@ template using ConstRowRef = const RowRef&; namespace ipc { -// Boolean scalar +/** + * \defgroup eigen_ext Eigen Extensions + * \brief Extensions to Eigen types for IPC. + * @{ + */ + +/// @brief An array of boolean scalars using ArrayXb = Eigen::Array; +/// @brief A Vector of boolean scalars using VectorXb = Eigen::Matrix; +/// @brief A Vector of boolean scalars with a fixed size of 3x1 using Vector3b = Eigen::Matrix; +/// @brief A dynamic size matrix of boolean scalars using MatrixXb = Eigen::Matrix; +/// @brief A dynamic size vector with a fixed maximum size. +/// @tparam T The type of the vector elements. +/// @tparam dim The size of the vector. +/// @tparam max_dim The maximum size of the vector. template using Vector = Eigen::Matrix; + +/// @brief A dynamic size row vector with a fixed maximum size. +/// @tparam T The type of the vector elements. +/// @tparam dim The size of the vector. +/// @tparam max_dim The maximum size of the vector. template using RowVector = Eigen::Matrix; +/// @brief A static size matrix of size of 1×1 using Vector1d = Eigen::Vector; +/// @brief A static size matrix of size of 6×1 using Vector6d = Eigen::Vector; +/// @brief A static size matrix of size of 9×1 using Vector9d = Eigen::Vector; +/// @brief A static size matrix of size of 12×1 using Vector12d = Eigen::Vector; +/// @brief A static size matrix of size of 6×6 using Matrix6d = Eigen::Matrix; +/// @brief A static size matrix of size of 9×9 using Matrix9d = Eigen::Matrix; +/// @brief A static size matrix of size of 12×12 using Matrix12d = Eigen::Matrix; /// @brief A dynamic size matrix with a fixed maximum size of 3×1 @@ -137,6 +162,8 @@ using ArrayMax4d = ArrayMax4; /// @brief A dynamic size array with a fixed maximum size of 4×1 using ArrayMax4i = ArrayMax4; +/**@}*/ + /// @brief Matrix projection onto positive definite cone /// @param A Symmetric matrix to project /// @param eps Minimum eigenvalue threshold @@ -176,6 +203,9 @@ project_to_psd( const Eigen::Matrix<_Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols>& A, const PSDProjectionMethod method = PSDProjectionMethod::CLAMP); +/// @brief Convert a 2D or 3D vector to a 3D vector. +/// @param v Vector to convert, can be 2D or 3D. +/// @return Converted 3D vector. If 2D, the z-component is set to 0. inline Eigen::Vector3d to_3D(Eigen::ConstRef v) { assert(v.size() == 2 || v.size() == 3); diff --git a/src/ipc/utils/interval.hpp b/src/ipc/utils/interval.hpp index 1699b1f02..fe70bdf0b 100644 --- a/src/ipc/utils/interval.hpp +++ b/src/ipc/utils/interval.hpp @@ -52,6 +52,9 @@ template <> struct fmt::formatter : ostream_formatter { }; namespace ipc { +/// @defgroup interval +/// @{ + /// @brief 2D vector of intervals using Vector2I = Eigen::Vector2; /// @brief 3D vector of intervals @@ -92,6 +95,8 @@ filib::Interval squared_norm(Eigen::ConstRef v); // L2 norm /// @return The L2 norm of the interval filib::Interval norm(Eigen::ConstRef v); // L2 norm +/// @} + } // namespace ipc namespace Eigen { diff --git a/src/ipc/utils/unordered_map_and_set.hpp b/src/ipc/utils/unordered_map_and_set.hpp index a86a732bf..96f284731 100644 --- a/src/ipc/utils/unordered_map_and_set.hpp +++ b/src/ipc/utils/unordered_map_and_set.hpp @@ -13,7 +13,7 @@ template H AbslHashValue(H h, T t); template struct Hash { Hash() = default; - Hash(size_t h) : hash(h) { }; + Hash(size_t h) : hash(h) { } template static Hash combine(const Hash& h, const Value value) From dfc683efce1ea98ed19fd6e27b7a633512d3c5df Mon Sep 17 00:00:00 2001 From: Zachary Ferguson Date: Sun, 13 Jul 2025 17:25:02 -0400 Subject: [PATCH 2/2] Remove port specification from livehtml target in Makefile --- docs/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/Makefile b/docs/Makefile index 39df4988c..d371e3710 100644 --- a/docs/Makefile +++ b/docs/Makefile @@ -27,4 +27,4 @@ xml: cd "$(SOURCEDIR)" && doxygen Doxyfile livehtml: - sphinx-autobuild --host 0.0.0.0 --port 8001 -j auto -a -q "$(SOURCEDIR)" "$(BUILDDIR)/html" $(SPHINXOPTS) $(O) + sphinx-autobuild --host 0.0.0.0 -j auto -a -q "$(SOURCEDIR)" "$(BUILDDIR)/html" $(SPHINXOPTS) $(O)