| 216 | } |
| 217 | |
| 218 | void test_cell_geometry( const geode::RegularGrid3D& grid ) |
| 219 | { |
| 220 | const auto pt0 = grid.point( grid.vertex_index( { 0, 0, 0 } ) ); |
| 221 | geode::OpenGeodeMeshException::test( pt0 == geode::Point3D( { 1.5, 0, 1 } ), |
| 222 | "Wrong point coordinates: ", pt0.string(), " instead of [1.5, 0, 1]." ); |
| 223 | const auto pt1 = grid.point( grid.vertex_index( { 0, 0, 1 } ) ); |
| 224 | geode::OpenGeodeMeshException::test( |
| 225 | pt1 == geode::Point3D( { 1.5, -3, 1 } ), |
| 226 | "Wrong point coordinates: ", pt1.string(), |
| 227 | " instead of [1.5, -3, 1]." ); |
| 228 | const auto pt2 = grid.point( grid.vertex_index( { 1, 1, 1 } ) ); |
| 229 | geode::OpenGeodeMeshException::test( |
| 230 | pt2 == geode::Point3D( { -0.5, -3, 2 } ), |
| 231 | "Wrong point coordinates: ", pt2.string(), |
| 232 | " instead of [-0.5, -3, 2]." ); |
| 233 | const auto pt3 = grid.point( grid.vertex_index( { 2, 1, 4 } ) ); |
| 234 | geode::OpenGeodeMeshException::test( |
| 235 | pt3 == geode::Point3D( { -0.5, -12, 3 } ), |
| 236 | "Wrong point coordinates: ", pt3.string(), |
| 237 | " instead of [-0.5, -12, 3]." ); |
| 238 | const auto pt4 = |
| 239 | grid.polyhedron_barycenter( grid.cell_index( { 2, 1, 4 } ) ); |
| 240 | geode::OpenGeodeMeshException::test( |
| 241 | pt4 == geode::Point3D( { -1.5, -13.5, 3.5 } ), |
| 242 | "Wrong point coordinates: ", pt4.string(), |
| 243 | " instead of [-1.5, -13.5, 3.5]." ); |
| 244 | } |
| 245 | |
| 246 | void test_cell_query( const geode::RegularGrid3D& grid ) |
| 247 | { |
no test coverage detected