MCPcopy Create free account
hub / github.com/PyMesh/PyMesh / TEST_F

Function TEST_F

tests/tools/IGL/MinkowskiSumTest.h:12–35  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

10};
11
12TEST_F(MinkowskiSumTest, Simple) {
13 MeshPtr mesh = load_mesh("cube.obj");
14
15 MatrixFr vertices = extract_vertices(mesh);
16 MatrixIr faces = extract_faces(mesh);
17
18 MatrixFr path(2, 3);
19 path << 0, 0, 0,
20 1, 0, 0;
21
22 MinkowskiSum ms(vertices, faces);
23 ms.run(path);
24
25 VectorF old_bbox_min = vertices.colwise().minCoeff();
26 VectorF old_bbox_max = vertices.colwise().maxCoeff();
27 VectorF new_bbox_min = ms.get_vertices().colwise().minCoeff();
28 VectorF new_bbox_max = ms.get_vertices().colwise().maxCoeff();
29
30 ASSERT_FLOAT_EQ(old_bbox_max[0] + 1, new_bbox_max[0]);
31 ASSERT_FLOAT_EQ(old_bbox_max[1], new_bbox_max[1]);
32 ASSERT_FLOAT_EQ(old_bbox_max[2], new_bbox_max[2]);
33
34 ASSERT_MATRIX_EQ(old_bbox_min, new_bbox_min);
35}
36
37TEST_F(MinkowskiSumTest, SmallOffset) {
38 const Float eps = 1e-12;

Callers

nothing calls this directly

Calls 9

load_meshFunction · 0.85
extract_verticesFunction · 0.85
extract_facesFunction · 0.85
runMethod · 0.45
get_verticesMethod · 0.45
get_facesMethod · 0.45
is_closedMethod · 0.45
is_orientedMethod · 0.45

Tested by

no test coverage detected