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

Function test_delete_polygon

tests/mesh/test-triangulated-surface.cpp:201–221  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

199}
200
201void test_delete_polygon( const geode::TriangulatedSurface3D& surface,
202 geode::TriangulatedSurfaceBuilder3D& builder )
203{
204 std::vector< bool > to_delete( surface.nb_polygons(), false );
205 to_delete.front() = true;
206 builder.delete_polygons( to_delete );
207 geode::OpenGeodeMeshException::test( surface.nb_polygons() == 2,
208 "TriangulatedSurface should have 2 polygons" );
209 geode::OpenGeodeMeshException::test(
210 surface.polygon_vertex( { 0, 0 } ) == 3,
211 "TriangulatedSurface edge vertex index is not correct" );
212 geode::OpenGeodeMeshException::test(
213 surface.polygon_vertex( { 0, 1 } ) == 2,
214 "TriangulatedSurface edge vertex index is not correct" );
215 geode::OpenGeodeMeshException::test(
216 surface.polygon_vertex( { 0, 2 } ) == 1,
217 "TriangulatedSurface edge vertex index is not correct" );
218 builder.edges_builder().delete_isolated_edges();
219 geode::OpenGeodeMeshException::test( surface.edges().nb_edges() == 5,
220 "TriangulatedSurface should have 5 edges" );
221}
222
223void test_io(
224 const geode::TriangulatedSurface3D& surface, std::string_view filename )

Callers 1

testFunction · 0.70

Calls 7

nb_polygonsMethod · 0.80
delete_polygonsMethod · 0.80
polygon_vertexMethod · 0.80
testFunction · 0.70
delete_isolated_edgesMethod · 0.45
edges_builderMethod · 0.45
nb_edgesMethod · 0.45

Tested by

no test coverage detected