MCPcopy Create free account
hub / github.com/Geode-solutions/OpenGeode / test_rasterize_triangle

Function test_rasterize_triangle

tests/mesh/test-rasterize.cpp:63–80  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

61}
62
63void test_rasterize_triangle(
64 const geode::RegularGrid3D& grid, const geode::Triangle3D& triangle )
65{
66 const auto cells = geode::conservative_rasterize_triangle( grid, triangle );
67 const absl::flat_hash_set< geode::index_t > answer{ 111, 112, 121, 122, 211,
68 212, 213, 221, 222, 223, 232, 233, 242, 243, 252, 253, 313, 314, 323,
69 324, 333, 334, 343, 344, 352, 353, 354, 363, 364, 373, 414, 415, 424,
70 425, 434, 435, 444, 445, 454, 464, 515, 516, 525, 526, 535 };
71 geode::OpenGeodeMeshException::test( answer.size() == cells.size(),
72 "Wrong number of result cells: ", cells.size(), " instead of ",
73 answer.size() );
74 for( const auto cell : cells )
75 {
76 geode::OpenGeodeMeshException::test(
77 answer.find( grid.cell_index( cell ) ) != answer.end(),
78 "Wrong result cells" );
79 }
80}
81
82void test_rasterize_degenerate_triangle(
83 const geode::RegularGrid3D& grid, const geode::Triangle3D& triangle )

Callers 1

testFunction · 0.85

Calls 6

testFunction · 0.70
sizeMethod · 0.45
findMethod · 0.45
cell_indexMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected