[Bf-committers] Re: [Bf-blender-cvs] CVS commit: blender/source/blender/python/api2_2x Mesh.c blender/source/blender/python/api2_2x/doc Mesh.py

Martin Poirier theeth at yahoo.com
Sun Dec 17 16:04:25 CET 2006


--- Campbell Barton <cbarton at metavr.com> wrote:

> Martin Poirier wrote:
> > --- Campbell Barton <cbarton at metavr.com> wrote:
> >
> >   
> >> A the moment edges have a hash function that
> returns
> >> the edge index,
> >>
> >> edge.key is the same as  (min(ed.v1.index,
> >> ed.v2.index), 
> >> max(ed.v1.index, ed.v2.index))
> >>
> >> Maybe they can be merged, any thaughts?
> >>     
> >
> > What's wrong with using the edge index as hash
> that
> > you had to create an artificial key instead?
> >
> > Martin
> >   
> if you want to find the edge that a face is using,
> you can get the 2 verts, order the pair of indicies
> and use them as a 
> key to get the edge.
> I was doing this in quite a few scripts, and while
> not dificuled its 
> fluff that can be better done this way.
> Heres an example of how connectivity data can be
> done with the new values.
> 
>        edge_faces = dict([(ed.key, []) for ed in
> me.edges])
>        for f in me.faces:
>            for key in f.edge_keys:
>                edge_faces[key].append(f) # add this
> face to the edge as 
> a user

I see. You need artificial keys because faces don't
contain information about their edges.

Wouldn't that be better fixed at the API level than
letting the scripters take care of it individually by
building edge lookups?

Martin

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 


More information about the Bf-committers mailing list