2011/5/21 Csanády István <istvancsan...@gmail.com> > Hello everybody, I'm István Csanády, and first of all, congrats to the > project, it is really fascinating, and incredibly useful. I am new to > pyocc, and trying to implement the basic opencascade "bottle > tutorial". My problem is, that I can not "translate" the following > part of the code from C++ to Python, since I dont know how to compare > DynamicTypes of objects. > Here is the C++ code: > for(TopExp_Explorer aFaceExplorer(myBody , TopAbs_FACE) ; > aFaceExplorer.More() ; aFaceExplorer.Next()){ > > TopoDS_Face aFace = TopoDS::Face(aFaceExplorer.Current()); > > Handle(Geom_Surface) aSurface = BRep_Tool::Surface(aFace); > > if(aSurface->DynamicType() == STANDARD_TYPE(Geom_Plane)) > //Question: how does this line should look like in Python > > > István >
Hi Istvan, I attached my make_bottle.py python port of the MakeBottle C++ example. It may be quite outdated, since I did not work on it for a while. Anayway, I think it's a good basis for further improvements. The STANDARD_TYPE(Geom_plane) has been replaced with some function face_is_plane() check. Note that this is a 'direct' port of the C++ code. This script makes no use of any of the highest level python modules we added to the basic wrapper. I never includeded this script as an official 'example' because it still needs a few hacks and is in a draft state. Hope you'll be able to make it cleaner. Best Regards, Thomas
makebottle.py
Description: Binary data
_______________________________________________ Pythonocc-users mailing list Pythonocc-users@gna.org https://mail.gna.org/listinfo/pythonocc-users