Hi: Im hoping to use pythonOCC as a part of a project I'm working on for the RepRap project. My goal is to use the OCC libraries to slice a solid into layers suitable for rapid prototyping.
Anyway, I've installed pythonOCC successfully, running Python 2.5 on Windows XP. When I run the below code ( which reads a STEP file and then attempts to enumerate the geometry with a TopExp.Topo_Explorer: from OCC import * import os import sys #read step file stepReader = STEPControl.STEPControl_Reader(); stepReader.ReadFile('Test.STEP') numItems = stepReader.NbRootsForTransfer(); numTranslated = stepReader.TransferRoots(); print numTranslated," Items Loaded." shape = stepReader.OneShape(); print shape; #make an explorer te = TopExp.TopExp_Explorer(); te.Init(shape,TopAbs.TopAbs_FACE); numFaces = 0 while te.More(): numFaces+= 1; te.Next(); print numFaces," Faces." The STEP file is read in properly, but then I get an error about the number of arguments to TopExp_Explorer.Init(): ... Step File Reading : Test.STEP ... STEP File Read ... Elapsed time: 0 Hour(s) 0 Minute(s) 0 Second(s) CPU user time: 0 seconds CPU kernel time: 0 seconds ... Step File loaded ... Elapsed time: 0 Hour(s) 0 Minute(s) 0 Second(s) CPU user time: 0 seconds CPU kernel time: 0 seconds 755 records (entities,sub-lists,scopes), 2200 parameters ... Parameters prepared ... Elapsed time: 0 Hour(s) 0 Minute(s) 0 Second( s) CPU user time: 0 seconds CPU kernel time: 0 seconds ... Objets analysed ... Elapsed time: 0 Hour(s) 0 Minute(s) 0.016 Second(s) CPU user time: 0.015625 seconds CPU kernel time: 0 seconds STEP Loading done : 528 Entities swig/python detected a memory leak of type 'IFSelect_ReturnStatus *', no destruc tor found. 1 Items Loaded. <OCC.TopoDS.TopoDS_Shape; proxy of <Swig Object of type 'TopoDS_Shape *' at 0x12 03a90> > Traceback (most recent call last): File "testOCC.py", line 18, in <module> te.Init(shape,TopAbs.TopAbs_FACE); File "C:\Python25\Lib\site-packages\OCC\TopExp.py", line 200, in Init return _TopExp.TopExp_Explorer_Init(*args) NotImplementedError: Wrong number of arguments for overloaded function 'TopExp_E xplorer_Init'. Possible C/C++ prototypes are: Init(TopExp_Explorer *,TopoDS_Shape const &,TopAbs_ShapeEnum const,TopAbs_Sh apeEnum const) Init(TopExp_Explorer *,TopoDS_Shape const &,TopAbs_ShapeEnum const) Can anyone help? Thanks!
_______________________________________________ Minerva-pythonocc mailing list Minerva-pythonocc@gna.org https://mail.gna.org/listinfo/minerva-pythonocc