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

Function convert_surface_dimension

tests/mesh/test-convert-surface.cpp:46–82  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

44#include <geode/mesh/helpers/convert_surface_mesh.hpp>
45
46void convert_surface_dimension()
47{
48 const auto surface2d = geode::load_triangulated_surface< 2 >(
49 absl::StrCat( geode::DATA_PATH, "3patches.og_tsf2d" ) );
50 const auto surface3d =
51 geode::convert_triangulated_surface2d_into_3d( *surface2d, 2, 0. );
52 geode::OpenGeodeMeshException::test(
53 surface2d->nb_vertices() == surface3d->nb_vertices(),
54 "Number of vertices in TriangulatedSurface3D is not "
55 "correct" );
56 geode::OpenGeodeMeshException::test(
57 surface2d->nb_polygons() == surface3d->nb_polygons(),
58 "Number of polygons in TriangulatedSurface3D is not "
59 "correct" );
60
61 const auto surface_mesh3d =
62 geode::convert_surface_mesh2d_into_3d( *surface2d, 2, 0. );
63 geode::OpenGeodeMeshException::test(
64 surface2d->nb_vertices() == surface_mesh3d->nb_vertices(),
65 "Number of vertices in SurfaceMesh3D is not "
66 "correct" );
67 geode::OpenGeodeMeshException::test(
68 surface2d->nb_polygons() == surface_mesh3d->nb_polygons(),
69 "Number of polygons in SurfaceMesh3D is not "
70 "correct" );
71
72 const auto converted_surface2d =
73 geode::convert_triangulated_surface3d_into_2d( *surface3d, 2 );
74 geode::OpenGeodeMeshException::test(
75 surface2d->nb_vertices() == converted_surface2d->nb_vertices(),
76 "Number of vertices in re-converted TriangulatedSurface2D "
77 "is not correct" );
78 geode::OpenGeodeMeshException::test(
79 surface2d->nb_polygons() == converted_surface2d->nb_polygons(),
80 "Number of polygons in re-converted TriangulatedSurface2D "
81 "is not correct" );
82}
83
84void convert_grid_to_surface()
85{

Callers 1

testFunction · 0.85

Calls 6

nb_polygonsMethod · 0.80
testFunction · 0.70
nb_verticesMethod · 0.45

Tested by

no test coverage detected