This repository was archived by the owner on Oct 22, 2025. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathipc.cpp
More file actions
92 lines (74 loc) · 2.99 KB
/
Copy pathipc.cpp
File metadata and controls
92 lines (74 loc) · 2.99 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
#include <common.hpp>
#include <ipc/ipc.hpp>
#include <ipc/config.hpp>
#include <igl/edges.h>
using namespace ipc;
void define_ipc(py::module_& m)
{
m.attr("__version__") = IPC_TOOLKIT_VER;
m.def(
"is_step_collision_free", &is_step_collision_free,
R"ipc_Qu8mg5v7(
Determine if the step is collision free.
Note:
Assumes the trajectory is linear.
Parameters:
mesh: The collision mesh.
vertices_t0: Surface vertex vertices at start as rows of a matrix.
vertices_t1: Surface vertex vertices at end as rows of a matrix.
min_distance: The minimum distance allowable between any two elements.
broad_phase: Broad phase to use.
narrow_phase_ccd: The narrow phase CCD algorithm to use.
Returns:
True if <b>any</b> collisions occur.
)ipc_Qu8mg5v7",
"mesh"_a, "vertices_t0"_a, "vertices_t1"_a, "min_distance"_a = 0.0,
"broad_phase"_a = make_default_broad_phase(),
"narrow_phase_ccd"_a = DEFAULT_NARROW_PHASE_CCD);
m.def(
"compute_collision_free_stepsize", &compute_collision_free_stepsize,
R"ipc_Qu8mg5v7(
Computes a maximal step size that is collision free.
Note:
Assumes the trajectory is linear.
Parameters:
mesh: The collision mesh.
vertices_t0: Vertex vertices at start as rows of a matrix. Assumes vertices_t0 is intersection free.
vertices_t1: Surface vertex vertices at end as rows of a matrix.
min_distance: The minimum distance allowable between any two elements.
broad_phase: Broad phase to use.
narrow_phase_ccd: The narrow phase CCD algorithm to use.
Returns:
A step-size :math:`\in [0, 1]` that is collision free. A value of 1.0 if a full step and 0.0 is no step.
)ipc_Qu8mg5v7",
"mesh"_a, "vertices_t0"_a, "vertices_t1"_a, "min_distance"_a = 0.0,
"broad_phase"_a = make_default_broad_phase(),
"narrow_phase_ccd"_a = DEFAULT_NARROW_PHASE_CCD);
m.def(
"has_intersections", &has_intersections,
R"ipc_Qu8mg5v7(
Determine if the mesh has self intersections.
Parameters:
mesh: The collision mesh.
vertices: Vertices of the collision mesh.
broad_phase: Broad phase to use.
Returns:
A boolean for if the mesh has intersections.
)ipc_Qu8mg5v7",
"mesh"_a, "vertices"_a, "broad_phase"_a = make_default_broad_phase());
m.def(
"edges",
[](Eigen::ConstRef<Eigen::MatrixXi> F) {
Eigen::MatrixXi E;
igl::edges(F, E);
return E;
},
R"ipc_Qu8mg5v7(
Constructs a list of unique edges represented in a given mesh F
Parameters:
F: #F by 3 list of mesh faces (must be triangles)
Returns:
#E by 2 list of edges in no particular order
)ipc_Qu8mg5v7",
"F"_a);
}