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 extract edges from solids. That's when I ran into the Null Shapes > issue with your Topo class (and TopExp_Explorer). > > Knowing I can't make lists of subshapes I could work round this but as I > think about the requirements of a chamfer-tool, tracking sub-shapes is a > difficult problem which OCAF/TNaming addresses. My traits example > doesn't (yet) hook up to OCAF (although this is perfectly possible) so > I'm not going to bother with the chamfer-tool after all. I was just > going to post what I've got on the wiki, but it doesn't appear to do > syntax highlighting (any chance of setting up a MoinMoin wiki instead? > it's more python-friendly). > > ... so ... I'll just post the code here ... > > There are 4 files attached. Run feature_tree_test.py. You need Traits > installed (version >=3.0 should be OK), with a Traits-UI backend (I've > only tested with the WX backend). > > The model is constructed from a box and a sphere and a boolean-op > filter. You can select any of these objects from the tree and edit them > and see the result in the wxViewer3d window. > > This code also serves as an example of how to update a > AIS_InteractiveContext with a new Shape, after some edit operation. > > I going to press on with OCAF stuff... > > Bryan >
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. Cheers, Thomas _______________________________________________ Pythonocc-users mailing list Pythonocc-users@gna.org https://mail.gna.org/listinfo/pythonocc-users