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

Function TEST_F

tests/src/Attributes/VoxelCircumCenterAttributeTest.h:9–25  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

7};
8
9TEST_F(VoxelCircumCenterAttributeTest, tet) {
10 MeshPtr mesh = load_mesh("tet.msh");
11 mesh->add_attribute("voxel_circumcenter");
12 ASSERT_TRUE(mesh->has_attribute("voxel_circumcenter"));
13 VectorF circumcenter = mesh->get_attribute("voxel_circumcenter");
14 ASSERT_EQ(3, circumcenter.size());
15
16 Float dist_0 = (circumcenter - mesh->get_vertex(0)).norm();
17 Float dist_1 = (circumcenter - mesh->get_vertex(1)).norm();
18 Float dist_2 = (circumcenter - mesh->get_vertex(2)).norm();
19 Float dist_3 = (circumcenter - mesh->get_vertex(3)).norm();
20
21 ASSERT_FLOAT_EQ(dist_0, dist_1);
22 ASSERT_FLOAT_EQ(dist_1, dist_2);
23 ASSERT_FLOAT_EQ(dist_2, dist_3);
24 ASSERT_FLOAT_EQ(dist_3, dist_0);
25}
26
27TEST_F(VoxelCircumCenterAttributeTest, irregular_tet) {
28 MatrixFr vertices(4, 3);

Callers

nothing calls this directly

Calls 7

load_meshFunction · 0.85
normMethod · 0.80
add_attributeMethod · 0.45
has_attributeMethod · 0.45
get_attributeMethod · 0.45
sizeMethod · 0.45
get_vertexMethod · 0.45

Tested by

no test coverage detected