Thanks! I managed a workaround by exporting to STL and parsing that, with
the added benefit of not having to calculate normals, but will try this fix
at some point...

On Mon, Jan 10, 2011 at 9:54 PM, Thomas Paviot <[email protected]> wrote:

> Hi Benjamin,
>
> This 0.4 issue was fixed by commit 918 (
> http://code.google.com/p/pythonocc/source/detail?r=918&path=/trunk/src/wrapper/SWIG_generator.py
> ).
>
> The facesIterator, edgesIterator or nodeIterator was really difficult to
> wrap. Shortcuts to these methos are:
> faceValue(i), edgesValue(i) and nodeValue(i) that return the value of the
> i-th element of the tuple.
>
> An example is available in the svn trunk (traverse_mesh.py) at:
> http://code.google.com/p/pythonocc/source/browse/trunk/src/examples/Level1/SMESH/traverse_mesh.py?r=1131
>
>
> Best Regards,
>
> Thomas
>
> 2011/1/10 Benjamin Nortier <[email protected]>
>
>> Hello
>>
>> I'm trying to iterate over the faces of a mesh, but can't get the
>> iteration to work. The mesh does have faces as you can see below:
>>
>> In [288]: aMesh
>> Out[288]: <OCC.SMESH.SMESH_Mesh; proxy of <Swig Object of type 'SMESH_Mesh
>> *' at 0x122f8e540> >
>>
>> In [289]: aMesh.GetMeshDS()
>> Out[289]: <OCC.SMESHDS.SMESHDS_Mesh; proxy of <Swig Object of type
>> 'SMESHDS_Mesh *' at 0x122fd5120> >
>>
>> In [290]: aMesh.GetMeshDS().NbFaces()
>> Out[290]: 3454
>>
>> In [293]: it = aMesh.GetMeshDS().facesIterator()
>> swig/python detected a memory leak of type 'SMDS_FaceIteratorPtr *', no
>> destructor found.
>>
>> I was expecting to be able to do it.next() until I get a None, but can't
>> access even the first element. I'm new to most of this, so it might be
>> something obvious.
>>
>> Any ideas?
>>
>> Thanks!
>> Benjamin
>>
>>
>> --
>> Benjamin Nortier
>> [email protected]
>> http://www.twitter.com/bjnortier
>> http://www.1011ltd.com
>> +44 (0)778 946 1959
>>
>>
>>
>> _______________________________________________
>> Pythonocc-users mailing list
>> [email protected]
>> https://mail.gna.org/listinfo/pythonocc-users
>>
>>
>
> _______________________________________________
> Pythonocc-users mailing list
> [email protected]
> https://mail.gna.org/listinfo/pythonocc-users
>
>


-- 
Benjamin Nortier
[email protected]
http://www.twitter.com/bjnortier
http://www.1011ltd.com
+44 (0)778 946 1959
_______________________________________________
Pythonocc-users mailing list
[email protected]
https://mail.gna.org/listinfo/pythonocc-users

Reply via email to