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 = box.Shell()

results = set()
hashes = set()
it = TopoDS.TopoDS_Iterator(sh)
while it.More():
   s = it.Value()
   results.add(s)
   hashes.add(hash(s))
   it.Next()

it = TopoDS.TopoDS_Iterator(sh)
while it.More():
   s = it.Value()
   assert hash(s) in hashes   # this works as expected
   assert s in results        # this does NOT work as expected (fails)
   it.Next()


- Frank


jelle feringa wrote:
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

_______________________________________________
Pythonocc-users mailing list
Pythonocc-users@gna.org
https://mail.gna.org/listinfo/pythonocc-users

_______________________________________________
Pythonocc-users mailing list
Pythonocc-users@gna.org
https://mail.gna.org/listinfo/pythonocc-users

Reply via email to