readwrite.rst 488 Bytes
Newer Older
1 2 3 4 5

*************
I/O Functions
*************

Isaak Lim's avatar
Isaak Lim committed
6 7
OpenMesh provides functions that read and write meshes from and to files:
:func:`~openmesh.read_trimesh`, :func:`~openmesh.read_polymesh` and :func:`~openmesh.write_mesh`
8 9 10 11 12

.. code:: python

    import openmesh as om

Isaak Lim's avatar
Isaak Lim committed
13 14
    trimesh = om.read_trimesh("bunny.ply")
    polymesh = om.read_polymesh("bunny.ply")
15
    # modify mesh ...
Isaak Lim's avatar
Isaak Lim committed
16
    om.write_mesh(trimesh, "bunny.ply")
17

Isaak Lim's avatar
Isaak Lim committed
18
OpenMesh currently supports five file types: .obj, .off, .ply, .stl and .om