[Bf-python] face.index?

Michael Schardt M.Schardt at web.de
Wed Mar 16 11:41:34 CET 2005


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/503414ff/attachment.html>


More information about the Bf-python mailing list