[Bf-python] Thinmesh module, v1.1

Joseph Gilbert jgilbert at TIGR.org
Fri Sep 23 00:27:40 CEST 2005


Ken Hughes wrote:

>    mesh.appendEdges( [ (v[0],v[1]), (v[1],v[2]), (v[2],v[0]) ] )

Looks a little cumbersome to me. Maybe just (v[0],v[1]), (v[1],v[2]), 
(v[2],v[0]) without the list. (remember args is passed as a tuple) You 
could probably extract using the sequence protocol. I like the 
multi-edge construction - it's nice.  Why not have both?

> Advantage of this: there's only one MEM_callocN() / memcpy() needed 
> for this since I process the list of edges once

*ACK* BPy should never use guardedmalloc directly to alloc/free memory. 
Your looking for trouble mister.

> But since I'm relying on Python to build my list of tuples (and 
> assuming a more complex script is going to be using append() 
> operations to build the actual list) I don't know which is more 
> advantageous.  So later this weekend I'll try some tests with larger 
> meshs and see what results.

How would someone call an edge? (just wondering) For instance 
Mesh.edge[1] ? How do I know that mesh.appendEdges(v[0],v[1]) makes me 
and .edge[1]?
Also it seems edges are an ugly manual process where the user needs to 
define what an edge is. If it was me i would load all my verts into a 
list and run a loop:
e =([v1, v3],[ v3, v4], [v4, v5], [v6, v7])
for a, b in e:
...mesh.appendEdge(a,b)



More information about the Bf-python mailing list