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:
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user