Skip to content

Commit 86ee635

Browse files
authored
Fix CCD documentation (#140)
1 parent a42bad3 commit 86ee635

File tree

15 files changed

+145
-93
lines changed

15 files changed

+145
-93
lines changed

docs/source/_static/css/custom.css

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,51 @@
1+
.md-grid {
2+
max-width: max(1250px, 75vw) !important;
3+
}
4+
15
span.colon {
26
margin-left: -1em;
37
}
48

5-
dl.cpp.objdesc, dl.py.objdesc {
9+
dl.cpp.objdesc,
10+
dl.py.objdesc {
611
/* border: 0.05rem solid var(--md-primary-fg-color); */
712
border: 0.05rem solid rgb(68, 138, 255);
813
box-shadow: var(--md-shadow-z1);
914
border-radius: 0.4rem;
1015
overflow: hidden;
1116
}
1217

13-
dl.cpp.objdesc > dt, dl.py.objdesc > dt {
18+
dl.cpp.objdesc>dt,
19+
dl.py.objdesc>dt {
1420
padding-left: 0.5rem;
1521
padding-right: 0.5rem;
1622
}
1723

18-
dl.cpp.objdesc > dd, dl.py.objdesc > dd {
24+
dl.cpp.objdesc>dd,
25+
dl.py.objdesc>dd {
1926
margin: 0 1.875em;
2027
}
2128

22-
dl.py.objdesc > dd > details.toggle-details {
29+
dl.py.objdesc>dd>details.toggle-details {
2330
border: 0.05rem solid var(--md-primary-fg-color);
2431
box-shadow: var(--md-shadow-z1);
2532
border-radius: 0.4rem;
2633
overflow: hidden;
2734
}
2835

29-
dl.py.objdesc > dd > details.toggle-details > summary {
36+
dl.py.objdesc>dd>details.toggle-details>summary {
3037
border: 0;
3138
font-size: 0.8rem;
3239
}
3340

34-
dl.py.objdesc > dd > details.toggle-details > summary::before,
35-
dl.py.objdesc > dd > details.toggle-details > summary::after {
41+
dl.py.objdesc>dd>details.toggle-details>summary::before,
42+
dl.py.objdesc>dd>details.toggle-details>summary::after {
3643
background-color: var(--md-primary-fg-color--light);
3744
/* background-color: currentcolor; */
3845
top: auto;
3946
}
4047

41-
dl.py.objdesc > dd > details.toggle-details > summary > svg.tb-icon {
48+
dl.py.objdesc>dd>details.toggle-details>summary>svg.tb-icon {
4249
display: none;
4350
}
4451

@@ -77,4 +84,4 @@ margin: 0 !important;
7784
dl.api-field > dd > p {
7885
padding: 0 !important;
7986
margin: 0 !important;
80-
} */
87+
} */

docs/source/cpp-api/broad_phase.rst

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,31 +9,37 @@ Broad Phase
99
-----------
1010

1111
.. doxygenclass:: ipc::BroadPhase
12+
:allow-dot-graphs:
1213

1314
Brute Force
1415
-----------
1516

1617
.. doxygenclass:: ipc::BruteForce
18+
:allow-dot-graphs:
1719

1820
Hash Grid
1921
---------
2022

2123
.. doxygenclass:: ipc::HashGrid
24+
:allow-dot-graphs:
2225

2326
Spatial Hash
2427
------------
2528

2629
.. doxygenclass:: ipc::SpatialHash
30+
:allow-dot-graphs:
2731

2832
BVH
2933
---
3034

3135
.. doxygenclass:: ipc::BVH
36+
:allow-dot-graphs:
3237

3338
Sweep and Prune
3439
-----------------------
3540

3641
.. doxygenclass:: ipc::SweepAndPrune
42+
:allow-dot-graphs:
3743

3844
Sweep and Tiniest Queue
3945
-----------------------
@@ -43,4 +49,5 @@ Sweep and Tiniest Queue
4349
AABB
4450
----
4551

46-
.. doxygenclass:: ipc::AABB
52+
.. doxygenclass:: ipc::AABB
53+
:allow-dot-graphs:

docs/source/cpp-api/candidates.rst

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,43 +5,51 @@ Candidates
55
----------
66

77
.. doxygenclass:: ipc::Candidates
8+
:allow-dot-graphs:
89

910
Collision Stencil
1011
-----------------
1112

1213
.. doxygenclass:: ipc::CollisionStencil
14+
:allow-dot-graphs:
1315

1416

1517
Continuous Collision Candidate
1618
------------------------------
1719

1820
.. doxygenclass:: ipc::ContinuousCollisionCandidate
21+
:allow-dot-graphs:
1922

2023

2124
Vertex-Vertex Candidate
2225
-----------------------
2326

2427
.. doxygenclass:: ipc::VertexVertexCandidate
28+
:allow-dot-graphs:
2529

2630

2731
Edge-Vertex Candidate
2832
---------------------
2933

3034
.. doxygenclass:: ipc::EdgeVertexCandidate
35+
:allow-dot-graphs:
3136

3237

3338
Edge-Edge Candidate
3439
-------------------
3540

3641
.. doxygenclass:: ipc::EdgeEdgeCandidate
42+
:allow-dot-graphs:
3743

3844

3945
Edge-Face Candidate
4046
-------------------
4147

4248
.. doxygenclass:: ipc::EdgeFaceCandidate
49+
:allow-dot-graphs:
4350

4451
Face-Vertex Candidate
4552
---------------------
4653

47-
.. doxygenclass:: ipc::FaceVertexCandidate
54+
.. doxygenclass:: ipc::FaceVertexCandidate
55+
:allow-dot-graphs:

docs/source/cpp-api/ccd.rst

Lines changed: 31 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -5,41 +5,45 @@ Continuous Collision Detection
55

66
.. doxygenfunction:: ipc::compute_collision_free_stepsize
77

8-
.. doxygenvariable:: ipc::DEFAULT_CCD_TOLERANCE
9-
.. doxygenvariable:: ipc::DEFAULT_CCD_MAX_ITERATIONS
10-
.. doxygenvariable:: ipc::DEFAULT_CCD_CONSERVATIVE_RESCALING
8+
Narrow Phase CCD
9+
----------------
1110

12-
Individual CCD Functions
13-
------------------------
11+
.. doxygenclass:: ipc::NarrowPhaseCCD
12+
:allow-dot-graphs:
1413

15-
.. doxygenfunction:: ipc::point_point_ccd
16-
.. doxygenfunction:: ipc::point_edge_ccd
17-
.. doxygenfunction:: ipc::edge_edge_ccd
18-
.. doxygenfunction:: ipc::point_triangle_ccd
14+
Tight Inclusion CCD
15+
^^^^^^^^^^^^^^^^^^^
1916

20-
Generic Interface
21-
^^^^^^^^^^^^^^^^^
22-
23-
.. doxygenfunction:: ipc::ccd_strategy
17+
.. doxygenclass:: ipc::TightInclusionCCD
18+
:allow-dot-graphs:
2419

2520
Additive CCD
26-
------------
21+
^^^^^^^^^^^^
2722

28-
.. doxygenfunction:: ipc::additive_ccd::point_point_ccd
29-
.. doxygenfunction:: ipc::additive_ccd::point_edge_ccd
30-
.. doxygenfunction:: ipc::additive_ccd::edge_edge_ccd
31-
.. doxygenfunction:: ipc::additive_ccd::point_triangle_ccd
23+
.. doxygenclass:: ipc::AdditiveCCD
24+
:allow-dot-graphs:
3225

33-
Generic Interface
34-
^^^^^^^^^^^^^^^^^
26+
Inexact CCD
27+
^^^^^^^^^^^
28+
29+
.. note::
30+
This method is disabled by default. To enable it, set the
31+
``IPC_TOOLKIT_WITH_INEXACT_CCD`` CMake option to ``ON``.
3532

36-
.. doxygenfunction:: ipc::additive_ccd::additive_ccd
33+
.. .. doxygenclass:: ipc::InexactCCD
34+
.. :allow-dot-graphs:
35+
36+
.. doxygenfunction:: ipc::inexact_point_edge_ccd_2D
3737

3838
Nonlinear CCD
3939
-------------
4040

4141
.. doxygenclass:: ipc::NonlinearTrajectory
42+
:allow-dot-graphs:
43+
4244
.. doxygenclass:: ipc::IntervalNonlinearTrajectory
45+
:allow-dot-graphs:
46+
4347

4448
.. doxygenfunction:: ipc::point_point_nonlinear_ccd
4549
.. doxygenfunction:: ipc::point_edge_nonlinear_ccd
@@ -49,4 +53,9 @@ Nonlinear CCD
4953
Generic Interface
5054
^^^^^^^^^^^^^^^^^
5155

52-
.. doxygenfunction:: ipc::conservative_piecewise_linear_ccd
56+
.. doxygenfunction:: ipc::conservative_piecewise_linear_ccd
57+
58+
Miscellaneous
59+
-------------
60+
61+
.. doxygenfunction:: ipc::point_static_plane_ccd
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
Collision Mesh
22
==============
33

4-
.. doxygenclass:: ipc::CollisionMesh
4+
.. doxygenclass:: ipc::CollisionMesh
5+
:allow-dot-graphs:

docs/source/cpp-api/normal_collisions.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,25 +14,25 @@ Normal Collision
1414
:allow-dot-graphs:
1515

1616
Vertex-Vertex Normal Collision
17-
-----------------------------
17+
------------------------------
1818

1919
.. doxygenclass:: ipc::VertexVertexNormalCollision
2020
:allow-dot-graphs:
2121

2222
Edge-Vertex Normal Collision
23-
-----------------------------
23+
----------------------------
2424

2525
.. doxygenclass:: ipc::EdgeVertexNormalCollision
2626
:allow-dot-graphs:
2727

2828
Edge-Edge Normal Collision
29-
-----------------------------
29+
--------------------------
3030

3131
.. doxygenclass:: ipc::EdgeEdgeNormalCollision
3232
:allow-dot-graphs:
3333

3434
Face-Vertex Normal Collision
35-
-----------------------------
35+
----------------------------
3636

3737
.. doxygenclass:: ipc::FaceVertexNormalCollision
3838
:allow-dot-graphs:

docs/source/python-api/ccd.rst

Lines changed: 23 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -5,43 +5,37 @@ Continuous Collision Detection
55

66
.. autofunction:: ipctk.compute_collision_free_stepsize
77

8-
Individual CCD Functions
9-
------------------------
8+
Narrow Phase CCD
9+
----------------
1010

11-
.. .. autovariable:: ipctk.DEFAULT_CCD_TOLERANCE
12-
.. .. autovariable:: ipctk.DEFAULT_CCD_MAX_ITERATIONS
13-
.. .. autovariable:: ipctk.DEFAULT_CCD_CONSERVATIVE_RESCALING
11+
.. autoclass:: ipctk.NarrowPhaseCCD
1412

15-
.. autofunction:: ipctk.point_point_ccd
16-
.. autofunction:: ipctk.point_edge_ccd
17-
.. autofunction:: ipctk.edge_edge_ccd
18-
.. autofunction:: ipctk.point_triangle_ccd
19-
20-
Generic Interface
21-
^^^^^^^^^^^^^^^^^
22-
23-
.. autofunction:: ipctk.ccd_strategy
13+
.. autoclasstoc::
2414

2515
Tight Inclusion CCD
26-
-------------------
16+
^^^^^^^^^^^^^^^^^^^
2717

28-
.. autofunction:: ipctk.tight_inclusion.edge_edge_ccd
29-
.. autofunction:: ipctk.tight_inclusion.point_triangle_ccd
18+
.. autoclass:: ipctk.TightInclusionCCD
3019

31-
.. autofunction:: ipctk.tight_inclusion.compute_ccd_filters
20+
.. autoclasstoc::
3221

3322
Additive CCD
34-
------------
23+
^^^^^^^^^^^^
3524

36-
.. autofunction:: ipctk.additive_ccd.point_point_ccd
37-
.. autofunction:: ipctk.additive_ccd.point_edge_ccd
38-
.. autofunction:: ipctk.additive_ccd.edge_edge_ccd
39-
.. autofunction:: ipctk.additive_ccd.point_triangle_ccd
25+
.. autoclass:: ipctk.AdditiveCCD
4026

41-
Generic Interface
42-
^^^^^^^^^^^^^^^^^
27+
.. autoclasstoc::
4328

44-
.. autofunction:: ipctk.additive_ccd.additive_ccd
29+
Inexact CCD
30+
^^^^^^^^^^^
31+
32+
.. note::
33+
This method is disabled by default. To enable it, set the
34+
``IPC_TOOLKIT_WITH_INEXACT_CCD`` CMake option to ``ON``.
35+
36+
.. .. autoclass:: ipctk.InexactCCD
37+
38+
.. autofunction:: ipctk.inexact_point_edge_ccd_2D
4539

4640
Nonlinear CCD
4741
-------------
@@ -59,7 +53,7 @@ Nonlinear CCD
5953
.. autofunction:: ipctk.edge_edge_nonlinear_ccd
6054
.. autofunction:: ipctk.point_triangle_nonlinear_ccd
6155

62-
Generic Interface
63-
^^^^^^^^^^^^^^^^^
56+
Miscellaneous
57+
-------------
6458

65-
.. autofunction:: ipctk.conservative_piecewise_linear_ccd
59+
.. autofunction:: ipctk.point_static_plane_ccd

python/src/ccd/inexact_point_edge.cpp

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,23 @@ void define_inexact_point_edge(py::module_& m)
1919
conservative_rescaling);
2020
return std::make_tuple(r, toi);
2121
},
22+
R"ipc_Qu8mg5v7(
23+
Inexact continuous collision detection between a point and an edge in 2D.
24+
25+
Parameters:
26+
p_t0: Initial position of the point
27+
e0_t0: Initial position of the first endpoint of the edge
28+
e1_t0: Initial position of the second endpoint of the edge
29+
p_t1: Final position of the point
30+
e0_t1: Final position of the first endpoint of the edge
31+
e1_t1: Final position of the second endpoint of the edge
32+
conservative_rescaling: Conservative rescaling of the time of impact
33+
34+
Returns:
35+
Tuple of:
36+
True if a collision was detected, false otherwise.
37+
Output time of impact
38+
)ipc_Qu8mg5v7",
2239
py::arg("p_t0"), py::arg("e0_t0"), py::arg("e1_t0"), py::arg("p_t1"),
2340
py::arg("e0_t1"), py::arg("e1_t1"), py::arg("conservative_rescaling"));
2441
}

0 commit comments

Comments
 (0)