[Bf-python] Thinmesh module, v1.1
Ken Hughes
khughes at pacific.edu
Sat Sep 24 18:26:56 CEST 2005
Joseph Gilbert wrote:
>
> Ken Hughes wrote:
>
>> Joseph Gilbert wrote:
>>>
>>> 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]?
>>
>> Should addEdges() return a sequence of edges, corresponging to each
>> vertex pair? Or is the edge list only needed to add faces; maybe in
>> that case we just make an addFaces() method which takes vert pairs
>> and/or edges and makes the faces, creating edges and verts where needed?
>>
> Maybe the edge should have someway to test to see if it contains a vert.
> Something like:
>
> for edge in mesh.edges:
> ...if v1 in edge:
> ......myEdgeList.append(edge)
>
> This would mean that 'edge' would need to implement the sequence
> protocol...
I can see sequence operations for edge which give the vertices (and for
face which give the edges) would be useful. Thanks.
> .... Returning a reference to the edge in the
> container i don't think is needed. Rarely would someone call:
> mesh.addEdges(e)[1].callSomething
> This seems a bit bizarre to me.
I was thinking more along the lines of:
edges = mesh.addEdges((v0,v1),(v1,v2),(v2,v0))
mesh.addFace (edges)
I plan to look through some of Cam and other's scripts to get a feel for
how script writers are handling the creation and deletion of mesh data.
However, I'm still hoping to get suggestions on things missing from
NMesh API; maybe reading between the lines in scripts will clue me in.
Ken
Ken
More information about the Bf-python
mailing list