-
Notifications
You must be signed in to change notification settings - Fork 48
Expand file tree
/
Copy patharea.cpp
More file actions
38 lines (30 loc) · 996 Bytes
/
area.cpp
File metadata and controls
38 lines (30 loc) · 996 Bytes
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
#include <common.hpp>
#include <ipc/geometry/area.hpp>
#include <ipc/utils/eigen_ext.hpp>
using namespace ipc;
void define_area(py::module_& m)
{
m.def(
"edge_length_gradient", &edge_length_gradient,
R"ipc_Qu8mg5v7(
Compute the gradient of an edge's length.
Parameters:
e0: The first vertex of the edge.
e1: The second vertex of the edge.
Returns:
The gradient of the edge's length wrt e0, and e1.
)ipc_Qu8mg5v7",
"e0"_a, "e1"_a);
m.def(
"triangle_area_gradient", &triangle_area_gradient,
R"ipc_Qu8mg5v7(
Compute the gradient of the area of a triangle.
Parameters:
t0: The first vertex of the triangle.
t1: The second vertex of the triangle.
t2: The third vertex of the triangle.
Returns:
The gradient of the triangle's area t0, t1, and t2.
)ipc_Qu8mg5v7",
"t0"_a, "t1"_a, "t2"_a);
}