-
Notifications
You must be signed in to change notification settings - Fork 47
Expand file tree
/
Copy pathangle.cpp
More file actions
60 lines (52 loc) · 1.82 KB
/
angle.cpp
File metadata and controls
60 lines (52 loc) · 1.82 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
#include <common.hpp>
#include <ipc/geometry/angle.hpp>
using namespace ipc;
void define_angle(py::module_& m)
{
m.def(
"dihedral_angle", &dihedral_angle,
R"ipc_Qu8mg5v7(
Compute the bending angle between two triangles sharing an edge.
x0---x2
| \ |
x1---x3
Parameters
----------
x0 : Eigen::Vector3d
The first vertex of the edge.
x1 : Eigen::Vector3d
The second vertex of the edge.
x2 : Eigen::Vector3d
The opposite vertex of the first triangle.
x3 : Eigen::Vector3d
The opposite vertex of the second triangle.
Returns
-------
double
The bending angle between the two triangles.
)ipc_Qu8mg5v7",
py::arg("x0"), py::arg("x1"), py::arg("x2"), py::arg("x3"));
m.def(
"dihedral_angle_gradient", &dihedral_angle_gradient,
R"ipc_Qu8mg5v7(
Compute the Jacobian of the bending angle between two triangles sharing an edge.
x0---x2
| \ |
x1---x3
Parameters
----------
x0 : Eigen::Vector3d
The first vertex of the edge.
x1 : Eigen::Vector3d
The second vertex of the edge.
x2 : Eigen::Vector3d
The opposite vertex of the first triangle.
x3 : Eigen::Vector3d
The opposite vertex of the second triangle.
Returns
-------
Eigen::Vector<double, 12>
The Jacobian matrix of the bending angle with respect to the input vertices.
)ipc_Qu8mg5v7",
py::arg("x0"), py::arg("x1"), py::arg("x2"), py::arg("x3"));
}