Skip to content

Test App

The repository includes a small OpenGL test app under:

test/Vergeo2D.Mesh.TestApp/

It is useful when checking whether mesh generation, deformation, extraction, picking, validation, serialization, and rendering are wired together correctly.

From the Vergeo2D.Mesh repository:

Terminal window
dotnet run --project test/Vergeo2D.Mesh.TestApp/Vergeo2D.Mesh.TestApp.csproj

By default the app loads:

test/Vergeo2D.Mesh.TestApp/assets/character-base.png

Pass a custom image path as the first argument:

Terminal window
dotnet run --project test/Vergeo2D.Mesh.TestApp/Vergeo2D.Mesh.TestApp.csproj -- /path/to/image.png

Run smoke checks without opening the interactive preview:

Terminal window
dotnet run --project test/Vergeo2D.Mesh.TestApp/Vergeo2D.Mesh.TestApp.csproj -- --backend all --smoke

The test app covers the common end-to-end path:

  • loads image dimensions through Texture2D.LoadFromFile()
  • adapts image alpha to IMeshMask2D
  • adapts decoded alpha bytes through MeshMask2D.FromAlphaMap() in smoke tests
  • generates a masked contour mesh from the alpha silhouette
  • validates generated meshes through Mesh2D.Validate() and shows validation status in the panel
  • generates a connected grid for deformation preview
  • highlights nearest vertices and edges through MeshPicking2D
  • shows interpolated hover UVs through MeshPicking2D.TryGetFaceUV()
  • generates UVs from mesh positions
  • round-trips mesh JSON through Mesh2DSerializer in smoke tests
  • extracts render buffers with MeshRenderExtractor
  • uploads vertices and indices to OpenGL
  • uses RadialDragDeformer2D
  • commits deformation with Mesh2D.ApplyDeformer()

Use the test app as a smoke test after changing:

  • grid generation
  • mask behavior
  • validation diagnostics
  • picking helpers
  • serializer behavior
  • deformer code
  • MeshRenderExtractor
  • render buffer layout
  • texture loading

If the app can load an image, build the mesh, validate it, pick vertices/edges, draw it, and drag-deform the result, the core path is still connected.