You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/source/tutorials/faq.rst
+35Lines changed: 35 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -31,6 +31,41 @@ How do I build the edge matrix from the face matrix?
31
31
32
32
To build the edge matrix you can use :cpp:`igl::edges(faces, edges);` in C++ or :python:`ipctk.edges(faces)` in Python.
33
33
34
+
Is there a way to ignore select collisions?
35
+
-------------------------------------------
36
+
37
+
Yes, it is possible to ignore select collisions.
38
+
39
+
The functionality for doing so is through the :cpp:`BroadPhase::can_vertices_collide`.
40
+
This function takes two vertex IDs and returns a true if the vertices can collide otherwise false.
41
+
42
+
This is used to determine if any geometry connected to the verties can collide. E.g., when checking if vertex ``vi`` can collide with triangle ``f = (vj, vk, vl)``, the code checks:
This is a little limited since it will ignore the one-ring around a vertex instead of a single face-vertex pair, but hopefully that can get you started.
49
+
50
+
To get something more customized, you can try to modify the BroadPhase class, which has these functions hard-coded:
51
+
52
+
.. code-block:: c++
53
+
54
+
virtual bool can_edge_vertex_collide(size_t ei, size_t vi) const;
You can modify these with function pointers or override them to have the specific implementation you are interested in.
61
+
62
+
.. note::
63
+
64
+
If you are building collisions through the ``Candidates`` class, the ``Candidates::build`` function sets the ``BroadPhase::can_vertices_collide`` using the ``CollisionMesh::can_collide`` function pointer. This ``CollisionMesh::can_collide`` function uses the same interface as the ``BroadPhase::can_vertices_collide`` above.
65
+
66
+
.. warning::
67
+
This method is not recommended for Python since calling a Python lambda function from the C++ side is too slow to use. Instead there are ``SparseCanCollide`` and ``VertexPatchesCanCollide`` classes in Python to help do this efficiently.
68
+
34
69
My question is not answered here. What should I do?
0 commit comments