I've been making an attempt to build the pythonocc bindings myself, and i could use some help.
So far, I got py++, got gcc-xml installed ( had to build it from source since i have vs 2008 express edition ), and downloaded and installed swig. For VS9, i had to change a couple of the declarations of some constants from Standard_Real, which were throwing "invalid use of extern". I updated my environment.py to point to the opencascade libs, which i downloaded and installed. I downloaded the python scripts from SVN, and successfully ( I think ) generated the files in SWIG_src by running python setup.py install but i'm getting error about not having visual studio 2003 installed : Session Vars running install running build running build_ext error: Python was built with Visual Studio 2003; extensions must be built with a compiler than can generate compatible binaries. Visual Studio 2003 was not found on this system. If you have Cygwin installed, you can try compiling with MingW32, by passing "-c mingw32" to setup.py. I feel like i'm on a very long journey here. Can anyone provide me some tips on what combination of stuff I need installed to get this going? thanks! On Sat, Oct 4, 2008 at 9:13 PM, Dave Cowden <[EMAIL PROTECTED]> wrote: > 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