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

Function TEST_F

tests/tools/MeshUtils/BoundaryEdgesTest.h:17–34  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

15};
16
17TEST_F(BoundaryEdgesTest, SquareBoundary) {
18 MeshPtr mesh = load_mesh("square_2D.obj");
19 BoundaryEdges bd(*mesh.get());
20 ASSERT_EQ(4, bd.get_num_boundaries());
21
22 // Check each boudnary vertex lies on the boundary.
23 // A vertex is on the boundary of cube if it has a coordinate
24 // equals 1 or -1
25 for (size_t i=0; i<4; i++) {
26 VectorI face = bd.get_boundary(i);
27 for (size_t j=0; j<2; j++) {
28 VectorF vertex = mesh->get_vertex(face[j]);
29 Float max_coordinate = *std::max_element(vertex.data(), vertex.data() + vertex.size());
30 Float min_coordinate = *std::min_element(vertex.data(), vertex.data() + vertex.size());
31 ASSERT_FLOAT_EQ(1.0, std::max(fabs(min_coordinate), fabs(max_coordinate)));
32 }
33 }
34}
35
36TEST_F(BoundaryEdgesTest, BoundaryElementsContainsBoundary) {
37 MeshPtr mesh = load_mesh("square_2D.obj");

Callers

nothing calls this directly

Calls 11

load_meshFunction · 0.85
get_faceMethod · 0.80
findMethod · 0.80
getMethod · 0.45
get_num_boundariesMethod · 0.45
get_boundaryMethod · 0.45
get_vertexMethod · 0.45
sizeMethod · 0.45
get_boundary_elementMethod · 0.45
endMethod · 0.45
get_boundary_nodesMethod · 0.45

Tested by

no test coverage detected