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

Function TEST_F

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

Source from the content-addressed store, hash-verified

7};
8
9TEST_F(VoxelInradiusAttributeTest, tet) {
10 MeshPtr mesh = load_mesh("tet.msh");
11 mesh->add_attribute("voxel_inradius");
12 ASSERT_TRUE(mesh->has_attribute("voxel_inradius"));
13 VectorF inradius = mesh->get_attribute("voxel_inradius");
14 ASSERT_EQ(1, inradius.size());
15
16 mesh->add_attribute("voxel_volume");
17 VectorF volume = mesh->get_attribute("voxel_volume");
18 ASSERT_EQ(1, volume.size());
19
20 mesh->add_attribute("face_area");
21 VectorF area = mesh->get_attribute("face_area");
22 ASSERT_EQ(4, area.size());
23
24 ASSERT_FLOAT_EQ(volume[0], area.sum() * inradius[0] / 3.0);
25}

Callers

nothing calls this directly

Calls 5

load_meshFunction · 0.85
add_attributeMethod · 0.45
has_attributeMethod · 0.45
get_attributeMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected