[Bf-python] face.index?

Gilbert, Joseph jgilbert at tigr.org
Wed Mar 16 16:32:18 CET 2005


I think that's a good idea. :-)
 
-----Original Message-----
From: bf-python-bounces at projects.blender.org
[mailto:bf-python-bounces at projects.blender.org] On Behalf Of Michael
Schardt
Sent: Wednesday, March 16, 2005 5:42 AM
To: bf-python at projects.blender.org
Subject: [Bf-python] face.index?
 
Hello!
 
Are there any plans to add a "face.index" attribute to python? If not -
take this as a proposal ;-)
My question is because i've come across this problem when writing some
functions for computational geometry (like computing convex hulls and
voronoi diagrams):
For these algorithms you have to maintain lots of information for
vertices and/or faces - like adjacent faces, common edges, common
vertices, ...
Usually i store information like this in lists or dictionaries.
- Storing a vertex in a list or as key inside a dict is easy - simply
take the vertex.index as key and store any information you need as
values. 
  Then you can do any processing on the lists/dictionaries and when
you're done you can access the 'real' vertex of the mesh again - it's
mesh.verts[index].
 
- Unfortunately there's no such thing for faces. Sure you can use a
tuple of the vertex indices that make up the face as key. This works
fine. But if you want to access the 'real' face again you've got a
problem...
  Wouldn't it be nice if we could have a face.index attribute as well?
This could be used as key in dictionaries and you could later access the
face again with mesh.faces[index].
  
This would also make processing information for faces and vertices more
consistent.
 
Any thoughts or comments on this?
 
Greetings,
    Michael Schardt
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.blender.org/pipermail/bf-python/attachments/20050316/c4e0697e/attachment.html>


More information about the Bf-python mailing list