Re: [Pythonocc-users] TopExp_Explorer -> Python List

2009-04-23 Thread Jelle Feringa
Hi Frank, I just committed a new version that hopefully solves your problem. I added basic unit tests, but have not added a test for the __hash__ issue you identified. It would be great to have your feedback on this actually, a method for asserting that hashing works properly would be *reall

Re: [Pythonocc-users] TopExp_Explorer -> Python List

2009-04-23 Thread Frank Conradie
Hi guys, have you had some time to look at this strange TopoDS_Iterator issue yet? I'm not sure if I explained it very well, so here is another attempt at explaining the weird behaviour: 1. I use TopoDS_Iterator to collect all faces of a shell into a Python set, as well as collect the hash of

Re: [Pythonocc-users] TopExp_Explorer -> Python List

2009-04-23 Thread Thomas Paviot
Jelle Feringa a écrit : > > Dear Bryan, > > Thank you *so* much for the very impressive demo! > This really is a gem! > > Many thanks, > I completely agrre with that. Amazing work. > -jelle > Thomas ___ Pythonocc-users mailing list Pythonocc-us

Re: [Pythonocc-users] TopExp_Explorer -> Python List

2009-04-23 Thread Thomas Paviot
Bryan Cole a écrit : >> Hi Bryan, >> >> Thank you for sharing your code. It looks very interesting but >> unfortunately I was not able to run the script. It seems that the driver >> initialization (InitDriver) isn't correctly processed and segfaults >> (under Windows). I did not tested under Lin

Re: [Pythonocc-users] TopExp_Explorer -> Python List

2009-04-22 Thread Jelle Feringa
> Dear Bryan, Thank you *so* much for the very impressive demo! This really is a gem! Many thanks, -jelle ___ Pythonocc-users mailing list Pythonocc-users@gna.org https://mail.gna.org/listinfo/pythonocc-users

Re: [Pythonocc-users] TopExp_Explorer -> Python List

2009-04-22 Thread Bryan Cole
> > Hi Bryan, > > Thank you for sharing your code. It looks very interesting but > unfortunately I was not able to run the script. It seems that the driver > initialization (InitDriver) isn't correctly processed and segfaults > (under Windows). I did not tested under Linux. Rats. Sorry. I le

Re: [Pythonocc-users] TopExp_Explorer -> Python List

2009-04-21 Thread Frank Conradie
As a follow-up, here is how I work around this TopoDS_Iterator issue: * I temporarily append the shape returned by it.Value() to a TopTools_SequenceOfShape * Then I retrieve it from there again, and use this shape from then on - it works perfectly then and delivers a unique Python object for th

Re: [Pythonocc-users] TopExp_Explorer -> Python List

2009-04-21 Thread Frank Conradie
Here is my test case using TopoDS_Iterator - I was wrong about IsNull, as it does work correctly, but the iterator does not return a Python object that uniquely represent the shape: from OCC import TopExp, BRepPrimAPI, TopAbs, TopoDS box = BRepPrimAPI.BRepPrimAPI_MakeBox(10., 20., 30.) sh = bo

Re: [Pythonocc-users] TopExp_Explorer -> Python List

2009-04-21 Thread jelle feringa
> No, it has the same problem as the explorer - I used > TopTools_SequenceOfShape to work around the issue. I will try and find some > time tonight to send an example. Ah, now I remember ;') Many thanks Frank, I look fwd integrating your feedback! Cheers, -jelle

Re: [Pythonocc-users] TopExp_Explorer -> Python List

2009-04-21 Thread Thomas Paviot
Bryan Cole a écrit : >> How are you doing with pythonOCC development? >> I'm really curious ;') >> Is there some OCAF code you'd be willing to share? >> > > I was writing a little traits example illustrating > dependency-resolution. I wanted to add a Chamfer filter and hence needed > to extr

Re: [Pythonocc-users] TopExp_Explorer -> Python List

2009-04-21 Thread Frank Conradie
Jelle, No, it has the same problem as the explorer - I used TopTools_SequenceOfShape to work around the issue. I will try and find some time tonight to send an example. - Frank Jelle Feringa wrote: I'm surprised that the same issue occur with TopoDS_Iterator. TopoDS_Iterator does not have a

Re: [Pythonocc-users] TopExp_Explorer -> Python List

2009-04-21 Thread Jelle Feringa
> I'm surprised that the same issue occur with TopoDS_Iterator. > TopoDS_Iterator does not have any ReInit or Clear method. Do you > have a > piece of code that produces this bug? Thomas, I understood Frank used a TopoDS_Iterator to avoid the issue Bryan described? -jelle __

Re: [Pythonocc-users] TopExp_Explorer -> Python List

2009-04-21 Thread Thomas Paviot
Frank Conradie a écrit : > Ah, fantastic! I was going to post the same issue here, but have been > just swamped at work. My work-around was to add all found shapes > temporarily to a *TopTools_SequenceOfShape*, but the *ReInit()* way is > much less of a hack. > > By the way, the same issue happe

Re: [Pythonocc-users] TopExp_Explorer -> Python List

2009-04-21 Thread Jelle Feringa
Hi Frank, Well, if I'd use your method in Topo._loop_topo that would be pretty need, right? Cheers, -jelle On Apr 21, 2009, at 4:25 PM, Frank Conradie wrote: Ah, fantastic! I was going to post the same issue here, but have been just swamped at work. My work-around was to add all found

Re: [Pythonocc-users] TopExp_Explorer -> Python List

2009-04-21 Thread Frank Conradie
Ah, fantastic! I was going to post the same issue here, but have been just swamped at work. My work-around was to add all found shapes temporarily to a *TopTools_SequenceOfShape*, but the *ReInit()* way is much less of a hack. By the way, the same issue happens when using *TopoDS_Iterator*, bu

Re: [Pythonocc-users] TopExp_Explorer -> Python List

2009-04-21 Thread Jelle Feringa
> Do you think Utils.Topology.Topo do this by default? Seems a big > gotcha > otherwise. Not yet. Will by the end of the day ( SVN ). -jelle ___ Pythonocc-users mailing list Pythonocc-users@gna.org https://mail.gna.org/listinfo/pythonocc-users

Re: [Pythonocc-users] TopExp_Explorer -> Python List

2009-04-21 Thread Thomas Paviot
Bryan Cole a écrit : >> You just have to ReInit() the TopExp_Explorer instance at the end of the >> loop. >> > > Thanks for the tip! > Thanks for the feedback! > Do you think Utils.Topology.Topo do this by default? Seems a big gotcha > otherwise. > Don't think so. Jelle, what about

Re: [Pythonocc-users] TopExp_Explorer -> Python List

2009-04-21 Thread Bryan Cole
> > You just have to ReInit() the TopExp_Explorer instance at the end of the > loop. Thanks for the tip! Do you think Utils.Topology.Topo do this by default? Seems a big gotcha otherwise. Bryan ___ Pythonocc-users mailing list Pythonocc-users@gna

Re: [Pythonocc-users] TopExp_Explorer -> Python List

2009-04-21 Thread Jelle Feringa
> At the end of the iteration, e.g. when ex.More() is False, the > TopExp_Explorer instance is cleared (with the Clear() method). Then > all > the references to subshapes are lost and your list contains NULL > elements. Thanks Thomas for the precise analysis. I'll map this back to the Topology

Re: [Pythonocc-users] TopExp_Explorer -> Python List

2009-04-21 Thread Thomas Paviot
Bryan Cole a écrit : > Hi, > Hi Bryan, > I've started experimenting with TopExp_Explorer in order extract > sub-shapes from Shapes. When I try to store the results of the iteration > in a python list, all but the last extracted shapes become invalid. It > seems that TopExp_Explorer is re-using

Re: [Pythonocc-users] TopExp_Explorer -> Python List

2009-04-21 Thread Bryan Cole
> > How are you doing with pythonOCC development? > I'm really curious ;') > Is there some OCAF code you'd be willing to share? I was writing a little traits example illustrating dependency-resolution. I wanted to add a Chamfer filter and hence needed to extract edges from solids. That's when I

Re: [Pythonocc-users] TopExp_Explorer -> Python List

2009-04-21 Thread Jelle Feringa
> Hi Bryan, We dealt with nearly all memory issues when releasing 0.2, but this is something nasty that we haven't been able to work around yet. We're currently looking into this in order to find a solution. I've been working pretty extensively on pythonOCC & topology, and so far I haven't r

[Pythonocc-users] TopExp_Explorer -> Python List

2009-04-21 Thread Bryan Cole
Hi, I've started experimenting with TopExp_Explorer in order extract sub-shapes from Shapes. When I try to store the results of the iteration in a python list, all but the last extracted shapes become invalid. It seems that TopExp_Explorer is re-using some part of the data structure it outputs as