updated tutorial on reading and writing meshes with python bindings (Alexander Dielen)

git-svn-id: http://www.openmesh.org/svnrepo/OpenMesh/trunk@1217 fdac6126-5c0c-442c-9429-916003d36597
This commit is contained in:
Isaak Lim
2015-02-05 11:24:15 +00:00
parent c1da4db775
commit 01e75b1780
2 changed files with 85 additions and 1 deletions

View File

@@ -130,3 +130,29 @@ for vh in mesh.vertices():
prop_man[vh] += mesh.point(neighbor)
valence += 1
prop_man[vh] /= valence
##################################################
# I/O
##################################################
mesh = TriMesh()
read_mesh(mesh, "bunny.obj")
# modify mesh ...
write_mesh(mesh, "bunny.obj")
mesh = TriMesh()
mesh.request_halfedge_normals()
mesh.request_vertex_normals()
options = Options()
options += Options.VertexNormal
result = read_mesh(mesh, "bunny.obj", options)
if result:
print "everything worked"
else:
print "something went wrong"