Skip to content

How to smooth a mesh?

Sk. Mohammadul Haque edited this page Apr 6, 2019 · 1 revision

Open a mesh file, smooth and save it in another mesh file.

#include <meshlib.h>

int main(int argc, char* argv[])
{
    MESH m;
    if(argc<3)
    {
        printf("input and output mesh filenames not given\n");
    }
    else
    {
        m = mesh_load_file(argv[1]);
        mesh_laplacian_filter(m, 1);
        mesh_write_file(m, argv[2]);
        mesh_free_mesh(m);
    }
    return 0;
}