Simon, The 'bottle sample' was also my first pythonOCC attempt. The code is here:
http://svn.gna.org/viewcvs/pythonocc/trunk/src/samples/Tools/InteractiveViewer/scripts/Bottle.py?rev=450&view=markup But I did not check if it's compliant with the latest pythonOCC release. Cheers, Thomas 2009/12/13 Simon Kirkby <tig...@interthingy.com> > Hey Thomas, > > Found the solution. > > surf = BRep_Tool().Surface(TopoDS().Face(current_face)) > > slowly getting my head around it. > > Simon > > > Simon Kirkby wrote: > > Hey Thomas, > > > > Thanks for the prompt reply. :) > > > > I have had a look at PAF , should be the way to go in the longer term. > > However I was going to spend a good few hours getting my head around > > pythonOCC in general. It is a _massive_ api and the typing and toolkits > > are quite daunting. > > > > I tried the Brep_Tool as you sugguested: > > > > fused is my proto_bottle > > > >> faces = TopExp_Explorer(fused.Shape(),TopAbs_FACE) > >> mostZ = 0 > >> while faces.More(): > >> current_face = faces.Current() > >> surf = BRep_Tool().Surface(current_face) > >> faces.Next() > >> > > However it seems to give me a type error > > > > Traceback (most recent call last): > > File "./viewer.py", line 90, in <module> > > bottle() > > File "./viewer.py", line 77, in bottle > > surf = BRep_Tool().Surface(current_face) > > TypeError: in method 'BRep_Tool_Surface', argument 2 of type > > 'TopoDS_Face const &' > > > > I assume that it is looking for a face pointer rather that a direct face. > > > > Simon > > > > > > _______________________________________________ > > 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 >
_______________________________________________ Pythonocc-users mailing list Pythonocc-users@gna.org https://mail.gna.org/listinfo/pythonocc-users