diff --git a/docs/source/_static/css/custom.css b/docs/source/_static/css/custom.css index 0e6607e88..e50ce9fb2 100644 --- a/docs/source/_static/css/custom.css +++ b/docs/source/_static/css/custom.css @@ -1,8 +1,13 @@ +.md-grid { + max-width: max(1250px, 75vw) !important; +} + span.colon { margin-left: -1em; } -dl.cpp.objdesc, dl.py.objdesc { +dl.cpp.objdesc, +dl.py.objdesc { /* border: 0.05rem solid var(--md-primary-fg-color); */ border: 0.05rem solid rgb(68, 138, 255); box-shadow: var(--md-shadow-z1); @@ -10,35 +15,37 @@ dl.cpp.objdesc, dl.py.objdesc { overflow: hidden; } -dl.cpp.objdesc > dt, dl.py.objdesc > dt { +dl.cpp.objdesc>dt, +dl.py.objdesc>dt { padding-left: 0.5rem; padding-right: 0.5rem; } -dl.cpp.objdesc > dd, dl.py.objdesc > dd { +dl.cpp.objdesc>dd, +dl.py.objdesc>dd { margin: 0 1.875em; } -dl.py.objdesc > dd > details.toggle-details { +dl.py.objdesc>dd>details.toggle-details { border: 0.05rem solid var(--md-primary-fg-color); box-shadow: var(--md-shadow-z1); border-radius: 0.4rem; overflow: hidden; } -dl.py.objdesc > dd > details.toggle-details > summary { +dl.py.objdesc>dd>details.toggle-details>summary { border: 0; font-size: 0.8rem; } -dl.py.objdesc > dd > details.toggle-details > summary::before, -dl.py.objdesc > dd > details.toggle-details > summary::after { +dl.py.objdesc>dd>details.toggle-details>summary::before, +dl.py.objdesc>dd>details.toggle-details>summary::after { background-color: var(--md-primary-fg-color--light); /* background-color: currentcolor; */ top: auto; } -dl.py.objdesc > dd > details.toggle-details > summary > svg.tb-icon { +dl.py.objdesc>dd>details.toggle-details>summary>svg.tb-icon { display: none; } @@ -77,4 +84,4 @@ margin: 0 !important; dl.api-field > dd > p { padding: 0 !important; margin: 0 !important; -} */ +} */ \ No newline at end of file diff --git a/docs/source/cpp-api/broad_phase.rst b/docs/source/cpp-api/broad_phase.rst index bbc5490fd..4735e1b35 100644 --- a/docs/source/cpp-api/broad_phase.rst +++ b/docs/source/cpp-api/broad_phase.rst @@ -9,31 +9,37 @@ Broad Phase ----------- .. doxygenclass:: ipc::BroadPhase + :allow-dot-graphs: Brute Force ----------- .. doxygenclass:: ipc::BruteForce + :allow-dot-graphs: Hash Grid --------- .. doxygenclass:: ipc::HashGrid + :allow-dot-graphs: Spatial Hash ------------ .. doxygenclass:: ipc::SpatialHash + :allow-dot-graphs: BVH --- .. doxygenclass:: ipc::BVH + :allow-dot-graphs: Sweep and Prune ----------------------- .. doxygenclass:: ipc::SweepAndPrune + :allow-dot-graphs: Sweep and Tiniest Queue ----------------------- @@ -43,4 +49,5 @@ Sweep and Tiniest Queue AABB ---- -.. doxygenclass:: ipc::AABB \ No newline at end of file +.. doxygenclass:: ipc::AABB + :allow-dot-graphs: \ No newline at end of file diff --git a/docs/source/cpp-api/candidates.rst b/docs/source/cpp-api/candidates.rst index f9f85e3f4..d51ac008d 100644 --- a/docs/source/cpp-api/candidates.rst +++ b/docs/source/cpp-api/candidates.rst @@ -5,43 +5,51 @@ Candidates ---------- .. doxygenclass:: ipc::Candidates + :allow-dot-graphs: Collision Stencil ----------------- .. doxygenclass:: ipc::CollisionStencil + :allow-dot-graphs: Continuous Collision Candidate ------------------------------ .. doxygenclass:: ipc::ContinuousCollisionCandidate + :allow-dot-graphs: Vertex-Vertex Candidate ----------------------- .. doxygenclass:: ipc::VertexVertexCandidate + :allow-dot-graphs: Edge-Vertex Candidate --------------------- .. doxygenclass:: ipc::EdgeVertexCandidate + :allow-dot-graphs: Edge-Edge Candidate ------------------- .. doxygenclass:: ipc::EdgeEdgeCandidate + :allow-dot-graphs: Edge-Face Candidate ------------------- .. doxygenclass:: ipc::EdgeFaceCandidate + :allow-dot-graphs: Face-Vertex Candidate --------------------- -.. doxygenclass:: ipc::FaceVertexCandidate \ No newline at end of file +.. doxygenclass:: ipc::FaceVertexCandidate + :allow-dot-graphs: \ No newline at end of file diff --git a/docs/source/cpp-api/ccd.rst b/docs/source/cpp-api/ccd.rst index 4eaf92723..af752c89f 100644 --- a/docs/source/cpp-api/ccd.rst +++ b/docs/source/cpp-api/ccd.rst @@ -5,41 +5,45 @@ Continuous Collision Detection .. doxygenfunction:: ipc::compute_collision_free_stepsize -.. doxygenvariable:: ipc::DEFAULT_CCD_TOLERANCE -.. doxygenvariable:: ipc::DEFAULT_CCD_MAX_ITERATIONS -.. doxygenvariable:: ipc::DEFAULT_CCD_CONSERVATIVE_RESCALING +Narrow Phase CCD +---------------- -Individual CCD Functions ------------------------- +.. doxygenclass:: ipc::NarrowPhaseCCD + :allow-dot-graphs: -.. doxygenfunction:: ipc::point_point_ccd -.. doxygenfunction:: ipc::point_edge_ccd -.. doxygenfunction:: ipc::edge_edge_ccd -.. doxygenfunction:: ipc::point_triangle_ccd +Tight Inclusion CCD +^^^^^^^^^^^^^^^^^^^ -Generic Interface -^^^^^^^^^^^^^^^^^ - -.. doxygenfunction:: ipc::ccd_strategy +.. doxygenclass:: ipc::TightInclusionCCD + :allow-dot-graphs: Additive CCD ------------- +^^^^^^^^^^^^ -.. doxygenfunction:: ipc::additive_ccd::point_point_ccd -.. doxygenfunction:: ipc::additive_ccd::point_edge_ccd -.. doxygenfunction:: ipc::additive_ccd::edge_edge_ccd -.. doxygenfunction:: ipc::additive_ccd::point_triangle_ccd +.. doxygenclass:: ipc::AdditiveCCD + :allow-dot-graphs: -Generic Interface -^^^^^^^^^^^^^^^^^ +Inexact CCD +^^^^^^^^^^^ + +.. note:: + This method is disabled by default. To enable it, set the + ``IPC_TOOLKIT_WITH_INEXACT_CCD`` CMake option to ``ON``. -.. doxygenfunction:: ipc::additive_ccd::additive_ccd +.. .. doxygenclass:: ipc::InexactCCD +.. :allow-dot-graphs: + +.. doxygenfunction:: ipc::inexact_point_edge_ccd_2D Nonlinear CCD ------------- .. doxygenclass:: ipc::NonlinearTrajectory + :allow-dot-graphs: + .. doxygenclass:: ipc::IntervalNonlinearTrajectory + :allow-dot-graphs: + .. doxygenfunction:: ipc::point_point_nonlinear_ccd .. doxygenfunction:: ipc::point_edge_nonlinear_ccd @@ -49,4 +53,9 @@ Nonlinear CCD Generic Interface ^^^^^^^^^^^^^^^^^ -.. doxygenfunction:: ipc::conservative_piecewise_linear_ccd \ No newline at end of file +.. doxygenfunction:: ipc::conservative_piecewise_linear_ccd + +Miscellaneous +------------- + +.. doxygenfunction:: ipc::point_static_plane_ccd \ No newline at end of file diff --git a/docs/source/cpp-api/collision_mesh.rst b/docs/source/cpp-api/collision_mesh.rst index b682d450a..6917692fb 100644 --- a/docs/source/cpp-api/collision_mesh.rst +++ b/docs/source/cpp-api/collision_mesh.rst @@ -1,4 +1,5 @@ Collision Mesh ============== -.. doxygenclass:: ipc::CollisionMesh \ No newline at end of file +.. doxygenclass:: ipc::CollisionMesh + :allow-dot-graphs: \ No newline at end of file diff --git a/docs/source/cpp-api/normal_collisions.rst b/docs/source/cpp-api/normal_collisions.rst index 747628964..a07424f9c 100644 --- a/docs/source/cpp-api/normal_collisions.rst +++ b/docs/source/cpp-api/normal_collisions.rst @@ -14,25 +14,25 @@ Normal Collision :allow-dot-graphs: Vertex-Vertex Normal Collision ------------------------------ +------------------------------ .. doxygenclass:: ipc::VertexVertexNormalCollision :allow-dot-graphs: Edge-Vertex Normal Collision ------------------------------ +---------------------------- .. doxygenclass:: ipc::EdgeVertexNormalCollision :allow-dot-graphs: Edge-Edge Normal Collision ------------------------------ +-------------------------- .. doxygenclass:: ipc::EdgeEdgeNormalCollision :allow-dot-graphs: Face-Vertex Normal Collision ------------------------------ +---------------------------- .. doxygenclass:: ipc::FaceVertexNormalCollision :allow-dot-graphs: diff --git a/docs/source/python-api/ccd.rst b/docs/source/python-api/ccd.rst index 34ddcd9bc..06fea94d4 100644 --- a/docs/source/python-api/ccd.rst +++ b/docs/source/python-api/ccd.rst @@ -5,43 +5,37 @@ Continuous Collision Detection .. autofunction:: ipctk.compute_collision_free_stepsize -Individual CCD Functions ------------------------- +Narrow Phase CCD +---------------- -.. .. autovariable:: ipctk.DEFAULT_CCD_TOLERANCE -.. .. autovariable:: ipctk.DEFAULT_CCD_MAX_ITERATIONS -.. .. autovariable:: ipctk.DEFAULT_CCD_CONSERVATIVE_RESCALING +.. autoclass:: ipctk.NarrowPhaseCCD -.. autofunction:: ipctk.point_point_ccd -.. autofunction:: ipctk.point_edge_ccd -.. autofunction:: ipctk.edge_edge_ccd -.. autofunction:: ipctk.point_triangle_ccd - -Generic Interface -^^^^^^^^^^^^^^^^^ - -.. autofunction:: ipctk.ccd_strategy + .. autoclasstoc:: Tight Inclusion CCD -------------------- +^^^^^^^^^^^^^^^^^^^ -.. autofunction:: ipctk.tight_inclusion.edge_edge_ccd -.. autofunction:: ipctk.tight_inclusion.point_triangle_ccd +.. autoclass:: ipctk.TightInclusionCCD -.. autofunction:: ipctk.tight_inclusion.compute_ccd_filters + .. autoclasstoc:: Additive CCD ------------- +^^^^^^^^^^^^ -.. autofunction:: ipctk.additive_ccd.point_point_ccd -.. autofunction:: ipctk.additive_ccd.point_edge_ccd -.. autofunction:: ipctk.additive_ccd.edge_edge_ccd -.. autofunction:: ipctk.additive_ccd.point_triangle_ccd +.. autoclass:: ipctk.AdditiveCCD -Generic Interface -^^^^^^^^^^^^^^^^^ + .. autoclasstoc:: -.. autofunction:: ipctk.additive_ccd.additive_ccd +Inexact CCD +^^^^^^^^^^^ + +.. note:: + This method is disabled by default. To enable it, set the + ``IPC_TOOLKIT_WITH_INEXACT_CCD`` CMake option to ``ON``. + +.. .. autoclass:: ipctk.InexactCCD + +.. autofunction:: ipctk.inexact_point_edge_ccd_2D Nonlinear CCD ------------- @@ -59,7 +53,7 @@ Nonlinear CCD .. autofunction:: ipctk.edge_edge_nonlinear_ccd .. autofunction:: ipctk.point_triangle_nonlinear_ccd -Generic Interface -^^^^^^^^^^^^^^^^^ +Miscellaneous +------------- -.. autofunction:: ipctk.conservative_piecewise_linear_ccd \ No newline at end of file +.. autofunction:: ipctk.point_static_plane_ccd \ No newline at end of file diff --git a/python/src/ccd/inexact_point_edge.cpp b/python/src/ccd/inexact_point_edge.cpp index d6c02a345..58df61e1d 100644 --- a/python/src/ccd/inexact_point_edge.cpp +++ b/python/src/ccd/inexact_point_edge.cpp @@ -19,6 +19,23 @@ void define_inexact_point_edge(py::module_& m) conservative_rescaling); return std::make_tuple(r, toi); }, + R"ipc_Qu8mg5v7( + Inexact continuous collision detection between a point and an edge in 2D. + + Parameters: + p_t0: Initial position of the point + e0_t0: Initial position of the first endpoint of the edge + e1_t0: Initial position of the second endpoint of the edge + p_t1: Final position of the point + e0_t1: Final position of the first endpoint of the edge + e1_t1: Final position of the second endpoint of the edge + conservative_rescaling: Conservative rescaling of the time of impact + + Returns: + Tuple of: + True if a collision was detected, false otherwise. + Output time of impact + )ipc_Qu8mg5v7", py::arg("p_t0"), py::arg("e0_t0"), py::arg("e1_t0"), py::arg("p_t1"), py::arg("e0_t1"), py::arg("e1_t1"), py::arg("conservative_rescaling")); } diff --git a/python/src/ccd/point_static_plane.cpp b/python/src/ccd/point_static_plane.cpp index 31caebd5e..4902d31de 100644 --- a/python/src/ccd/point_static_plane.cpp +++ b/python/src/ccd/point_static_plane.cpp @@ -18,6 +18,21 @@ void define_point_static_plane(py::module_& m) conservative_rescaling); return std::make_tuple(r, toi); }, + R"ipc_Qu8mg5v7( + Compute the time of impact between a point and a static plane in 3D using continuous collision detection. + + Parameters: + p_t0: The initial position of the point. + p_t1: The final position of the point. + plane_origin: The origin of the plane. + plane_normal: The normal of the plane. + conservative_rescaling: Conservative rescaling of the time of impact. + + Returns: + Tuple of: + True if a collision was detected, false otherwise. + Output time of impact + )ipc_Qu8mg5v7", py::arg("p_t0"), py::arg("p_t1"), py::arg("plane_origin"), py::arg("plane_normal"), py::arg("conservative_rescaling") = diff --git a/python/src/collisions/tangential/tangential_collision.cpp b/python/src/collisions/tangential/tangential_collision.cpp index 6a6618e24..3cc131f16 100644 --- a/python/src/collisions/tangential/tangential_collision.cpp +++ b/python/src/collisions/tangential/tangential_collision.cpp @@ -72,7 +72,7 @@ void define_tangential_collision(py::module_& m) Compute the relative velocity of the collision. Parameters: - positions: Collision stencil's vertex velocities. + velocities: Collision stencil's vertex velocities. Returns: Relative velocity of the collision. diff --git a/src/ipc/ccd/inexact_ccd.hpp b/src/ipc/ccd/inexact_ccd.hpp index cd4fb1983..300aac98a 100644 --- a/src/ipc/ccd/inexact_ccd.hpp +++ b/src/ipc/ccd/inexact_ccd.hpp @@ -50,9 +50,6 @@ class InexactCCD : public NarrowPhaseCCD { /// @param[out] toi The time of impact between the point and the edge. /// @param[in] min_distance The minimum distance between the objects. /// @param[in] tmax The maximum time to check for collisions. - /// @param[in] tolerance The error tolerance for the time of impact. - /// @param[in] max_iterations The maximum number of iterations to perform. - /// @param[in] conservative_rescaling The conservative rescaling of the time of impact. /// @return True if a collision was detected, false otherwise. bool point_edge_ccd( const VectorMax3d& p_t0, @@ -77,9 +74,6 @@ class InexactCCD : public NarrowPhaseCCD { /// @param[out] toi The time of impact between the two edges. /// @param[in] min_distance The minimum distance between the objects. /// @param[in] tmax The maximum time to check for collisions. - /// @param[in] tolerance The error tolerance for the time of impact. - /// @param[in] max_iterations The maximum number of iterations to perform. - /// @param[in] conservative_rescaling The conservative rescaling of the time of impact. /// @return True if a collision was detected, false otherwise. bool edge_edge_ccd( const Eigen::Vector3d& ea0_t0, @@ -106,9 +100,6 @@ class InexactCCD : public NarrowPhaseCCD { /// @param[out] toi The time of impact between the point and the triangle. /// @param[in] min_distance The minimum distance between the objects. /// @param[in] tmax The maximum time to check for collisions. - /// @param[in] tolerance The error tolerance for the time of impact. - /// @param[in] max_iterations The maximum number of iterations to perform. - /// @param[in] conservative_rescaling The conservative rescaling of the time of impact. /// @return True if a collision was detected, false otherwise. bool point_triangle_ccd( const Eigen::Vector3d& p_t0, @@ -155,9 +146,6 @@ class InexactCCD : public NarrowPhaseCCD { /// @param[out] toi The time of impact between the point and the edge. /// @param[in] min_distance The minimum distance between the objects. /// @param[in] tmax The maximum time to check for collisions. - /// @param[in] tolerance The error tolerance for the time of impact. - /// @param[in] max_iterations The maximum number of iterations to perform. - /// @param[in] conservative_rescaling The conservative rescaling of the time of impact. /// @return True if a collision was detected, false otherwise. bool point_edge_ccd_3D( const Eigen::Vector3d& p_t0, diff --git a/src/ipc/ccd/inexact_point_edge.hpp b/src/ipc/ccd/inexact_point_edge.hpp index d1c1fe2b9..118b6efcc 100644 --- a/src/ipc/ccd/inexact_point_edge.hpp +++ b/src/ipc/ccd/inexact_point_edge.hpp @@ -11,6 +11,16 @@ namespace ipc { +/// @brief Inexact continuous collision detection between a point and an edge in 2D. +/// @param[in] p_t0 The initial position of the point. +/// @param[in] e0_t0 The initial position of the first endpoint of the edge. +/// @param[in] e1_t0 The initial position of the second endpoint of the edge. +/// @param[in] p_t1 The final position of the point. +/// @param[in] e0_t1 The final position of the first endpoint of the edge. +/// @param[in] e1_t1 The final position of the second endpoint of the edge. +/// @param[out] toi Output time of impact. +/// @param[in] conservative_rescaling The conservative rescaling of the time of impact. +/// @return True if a collision was detected, false otherwise. bool inexact_point_edge_ccd_2D( const Eigen::Vector2d& p_t0, const Eigen::Vector2d& e0_t0, diff --git a/src/ipc/ccd/point_static_plane.hpp b/src/ipc/ccd/point_static_plane.hpp index 1fe10cea0..9f177a38f 100644 --- a/src/ipc/ccd/point_static_plane.hpp +++ b/src/ipc/ccd/point_static_plane.hpp @@ -4,6 +4,14 @@ namespace ipc { +/// @brief Computes the time of impact between a point and a static plane in 3D using continuous collision detection. +/// @param[in] p_t0 The initial position of the point. +/// @param[in] p_t1 The final position of the point. +/// @param[in] plane_origin The origin of the plane. +/// @param[in] plane_normal The normal of the plane. +/// @param[out] toi Output time of impact. +/// @param[in] conservative_rescaling Conservative rescaling of the time of impact. +/// @return True if a collision was detected, false otherwise. bool point_static_plane_ccd( const VectorMax3d& p_t0, const VectorMax3d& p_t1, diff --git a/src/ipc/ccd/tight_inclusion_ccd.hpp b/src/ipc/ccd/tight_inclusion_ccd.hpp index 691f244fc..05af3c10e 100644 --- a/src/ipc/ccd/tight_inclusion_ccd.hpp +++ b/src/ipc/ccd/tight_inclusion_ccd.hpp @@ -52,9 +52,6 @@ class TightInclusionCCD : public NarrowPhaseCCD { /// @param[out] toi The time of impact between the point and the edge. /// @param[in] min_distance The minimum distance between the objects. /// @param[in] tmax The maximum time to check for collisions. - /// @param[in] tolerance The error tolerance for the time of impact. - /// @param[in] max_iterations The maximum number of iterations to perform. - /// @param[in] conservative_rescaling The conservative rescaling of the time of impact. /// @return True if a collision was detected, false otherwise. bool point_edge_ccd( const VectorMax3d& p_t0, @@ -79,9 +76,6 @@ class TightInclusionCCD : public NarrowPhaseCCD { /// @param[out] toi The time of impact between the two edges. /// @param[in] min_distance The minimum distance between the objects. /// @param[in] tmax The maximum time to check for collisions. - /// @param[in] tolerance The error tolerance for the time of impact. - /// @param[in] max_iterations The maximum number of iterations to perform. - /// @param[in] conservative_rescaling The conservative rescaling of the time of impact. /// @return True if a collision was detected, false otherwise. bool edge_edge_ccd( const Eigen::Vector3d& ea0_t0, @@ -108,9 +102,6 @@ class TightInclusionCCD : public NarrowPhaseCCD { /// @param[out] toi The time of impact between the point and the triangle. /// @param[in] min_distance The minimum distance between the objects. /// @param[in] tmax The maximum time to check for collisions. - /// @param[in] tolerance The error tolerance for the time of impact. - /// @param[in] max_iterations The maximum number of iterations to perform. - /// @param[in] conservative_rescaling The conservative rescaling of the time of impact. /// @return True if a collision was detected, false otherwise. bool point_triangle_ccd( const Eigen::Vector3d& p_t0, @@ -163,9 +154,6 @@ class TightInclusionCCD : public NarrowPhaseCCD { /// @param[out] toi The time of impact between the point and the edge. /// @param[in] min_distance The minimum distance between the objects. /// @param[in] tmax The maximum time to check for collisions. - /// @param[in] tolerance The error tolerance for the time of impact. - /// @param[in] max_iterations The maximum number of iterations to perform. - /// @param[in] conservative_rescaling The conservative rescaling of the time of impact. /// @return True if a collision was detected, false otherwise. bool point_edge_ccd_3D( const Eigen::Vector3d& p_t0, diff --git a/src/ipc/collisions/tangential/tangential_collision.hpp b/src/ipc/collisions/tangential/tangential_collision.hpp index ebb553682..976a1b6d6 100644 --- a/src/ipc/collisions/tangential/tangential_collision.hpp +++ b/src/ipc/collisions/tangential/tangential_collision.hpp @@ -56,7 +56,7 @@ class TangentialCollision : virtual public CollisionStencil { compute_closest_point_jacobian(const VectorMax12d& positions) const = 0; /// @brief Compute the relative velocity of the collision. - /// @param positions Collision stencil's vertex velocities. + /// @param velocities Collision stencil's vertex velocities. /// @return Relative velocity of the collision. virtual VectorMax3d relative_velocity(const VectorMax12d& velocities) const = 0;