2011/5/24 Csanády István <istvancsan...@gmail.com>

> OK, it's me again, sorry. In the release notes you wrote:
> "Wrappers for C++ static methods have been implemented in a SWIG
> compliant way. Static methods like: BRep_Tool::Surface() is now
> callable with either BRep_Tool().Surface() or BRep_Tool_Surface()"
>
> The first one does not work for me (BRep_Tool().Surface()) with any
> modules. For example, the Bottle example worked for me with 0.4 but
> now I can't make it work because of the following problem:
>
> xAxis = gp_OX()
> #I changed this from gp().OX(), because I got an error message: File
> "Bottle.py", line 67, in <module>
> #    xAxis = gp().OX()
> # TypeError: 'module' object is not callable
>

You should import the gp module with the statement:
from OCC.gp import *

otherwise the gp class may conflict with the gp module. Have a look at the
following lines, from OCC import gp raises an exception when trying to
instantiate a gp object:
macbook-pro-de-thomas-paviot:src thomas$ python
Python 2.6.1 (r261:67515, Jun 24 2010, 21:47:49)
[GCC 4.2.1 (Apple Inc. build 5646)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from OCC.gp import *
>>> gp()
<OCC.gp.gp; proxy of <Swig Object of type 'gp *' at 0x10053f780> >
>>> from OCC import gp
>>> gp()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: 'module' object is not callable
>>>


> aTrsf = gp_Trsf()
> aTrsf.SetMirror(xAxis)
> aBRepTrsf = BRepBuilderAPI_Transform(aWire.Shape() , aTrsf)
> aMirroredShape = aBRepTrsf.Shape()
> #This does not work either, not in th TopoDS().Wire() neither the
> TopoDS_Wire() form. For the first one I got similar error message like
> for the gp(), and for the second one I got this:
> #File "/Library/Python/2.6/site-packages/OCC/TopoDS.py", line 1912, in
> __init__
> #   _TopoDS.TopoDS_Wire_swiginit(self,_TopoDS.new_TopoDS_Wire(*args))
> #TypeError: in method 'new_TopoDS_Wire', argument 1 of type 'TopoDS_Wire
> const'
>

Import the TopoDS module with: from OCC.TopoDS import *

After that,
* TopoDS_Wire() instanciates a TopoDS_Wire object:
>>> TopoDS_Wire()
<OCC.TopoDS.TopoDS_Wire; proxy of <Swig Object of type 'TopoDS_Wire *' at
0x100544f30> >

* TopoDS_wire() and TopoDS().wire() calls the static function
TopoDS::Wire(), which is *absolutely* different:
>>> TopoDS_wire()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Library/Python/2.6/site-packages/OCC/TopoDS.py", line 1375, in
TopoDS_wire
    return _TopoDS.TopoDS_wire(*args)
NotImplementedError: Wrong number or type of arguments for overloaded
function 'TopoDS_wire'.
  Possible C/C++ prototypes are:
    Wire(TopoDS_Shape const)
    TopoDS::Wire(TopoDS_Shape &) <--- Look here, TopoDS:Wire is called



>
> aMirroredWire = TopoDS_Wire(aMirroredShape)
>
> Sorry for spamming the mailing list, but I am really excited about
> this project ;)
>
> István
>
>
Hope this helps,

Thomas


>  On Tue, May 24, 2011 at 2:28 PM, Thomas Paviot <tpav...@gmail.com> wrote:
> > You're welcome. Thanks for the bug report. Didn't notice this issue so
> far,
> > I'll test it and commit changes if it works.
> >
> > Thomas
> >
> > 2011/5/24 Csanády István <istvancsan...@gmail.com>
> >>
> >> Thanks Thomas, I really appreciate your help, I have succesfully
> >> compiled 0.5! However, I found a bug (?) in the visualization,
> >> OCCViewer.py (line #51). I had to replace
> >> v3d_module_library = sys.modules['_V3d'].__file__
> >>
> >> to
> >>
> >> v3d_module_library = sys.modules['OCC._V3d'].__file__
> >>
> >> because python couldn't find _V3d. (Python 2.6, Mac OSX 10.6.7)
> >> Anyway, it just works fine now. And again, thank you for helping me!
> >>
> >> István
> >>
> >> On Tue, May 24, 2011 at 9:13 AM, Thomas Paviot <tpav...@gmail.com>
> wrote:
> >> > 2011/5/24 Csanády István <istvancsan...@gmail.com>
> >> >>
> >> >> I am trying to compile pythonocc on mac os x 10.6. After a few hours
> >> >> of compilation I got the following error:
> >> >>
> >> >>
> >> >> /Library/OpenCASCADE/6.3.0/inc/config.h:38:1: warning: "HAVE_FINITE"
> >> >> redefined
> >> >> In file included from
> >> >>
> >> >>
> >> >>
> /System/Library/Frameworks/Python.framework/Versions/2.6/include/python2.6/Python.h:8,
> >> >>                 from
> >> >>
> >> >>
> >> >>
> /Users/istvancsanady/Downloads/pythonocc-0.5/src/wrapper/SWIG/linux_darwin/Archimede_wrap.cpp:129:
> >> >>
> >> >>
> >> >>
> /System/Library/Frameworks/Python.framework/Versions/2.6/include/python2.6/pyconfig.h:179:1:
> >> >> warning: this is the location of the previous definition
> >> >>
> >> >>
> >> >>
> /Users/istvancsanady/Downloads/pythonocc-0.5/src/wrapper/SWIG/linux_darwin/Archimede_wrap.cpp:
> >> >> In function ‘void SWIG_Python_AddErrorMsg(const char*)’:
> >> >>
> >> >>
> >> >>
> /Users/istvancsanady/Downloads/pythonocc-0.5/src/wrapper/SWIG/linux_darwin/Archimede_wrap.cpp:870:
> >> >> warning: format not a string literal and no format arguments
> >> >> g++-4.2 -F. --no_undefined -bundle -dynamic_lookup -arch x86_64 -m64
> >> >> -L. -lm -lstdc++ -lpython2.6
> >> >>
> >> >>
> >> >>
> build/temp.macosx-10.6-universal-2.6/Users/istvancsanady/Downloads/pythonocc-0.5/src/wrapper/SWIG/linux_darwin/Archimede_wrap.o
> >> >> -L/Library/OpenCASCADE/6.3.0/lib -L/usr/local/lib/ -L/usr/local/lib/
> >> >> -lBinLPlugin -lBinPlugin -lBinXCAFPlugin -lFWOSPlugin -lPTKernel
> >> >> -lStdLPlugin -lStdPlugin -lTKAdvTools -lTKBin -lTKBinL -lTKBinTObj
> >> >> -lTKBinXCAF -lTKBO -lTKBool -lTKBRep -lTKCAF -lTKCDF -lTKernel
> >> >> -lTKFeat -lTKFillet -lTKG2d -lTKG3d -lTKGeomAlgo -lTKGeomBase -lTKHLR
> >> >> -lTKIGES -lTKLCAF -lTKMath -lTKMesh -lTKMeshVS -lTKNIS -lTKOffset
> >> >> -lTKOpenGl -lTKPCAF -lTKPLCAF -lTKPrim -lTKPShape -lTKService
> >> >> -lTKShapeSchema -lTKShHealing -lTKStdLSchema -lTKStdSchema -lTKSTEP
> >> >> -lTKSTEP209 -lTKSTEPAttr -lTKSTEPBase -lTKSTL -lTKTObj -lTKTopAlgo
> >> >> -lTKV2d -lTKV3d -lTKVRML -lTKXCAF -lTKXCAFSchema -lTKXDEIGES
> >> >> -lTKXDESTEP -lTKXMesh -lTKXml -lTKXmlL -lTKXmlTObj -lTKXmlXCAF
> >> >> -lTKXSBase -lXCAFPlugin -lXmlLPlugin -lXmlPlugin -lXmlXCAFPlugin
> >> >> -lSketcher -lShHealOper -lPartition -lNMTTools -lNMTDS -lGEOM
> >> >> -lGEOMImpl -lGEOMAlgo -lArchimede -o
> >> >> build/lib.macosx-10.6-universal-2.6/OCC/_Archimede.so
> >> >> ld: library not found for -lSketcher
> >> >> collect2: ld returned 1 exit status
> >> >> error: command 'g++-4.2' failed with exit status 1
> >> >>
> >> >> It seems that ld does not find libSketcher.dylib however it is at
> >> >> /usr/local/lib/GEOM-5.1.2.7/libSketcher.dylib and the environmental
> >> >> variable DYLD_LIBRARY_PATH is defined as
> >> >>
> >> >>
> >> >>
> DYLD_LIBRARY_PATH=/usr/local/lib/SMESH-5.1.2.2:/usr/local/lib/GEOM-5.1.2.7:/Library/OpenCASCADE/6.3.0/lib:
> >> >>
> >> >> What am I doing wrong?
> >> >>
> >> >> Regards,
> >> >> István
> >> >
> >> > Hi Istvan,
> >> >
> >> > In case you have problems with DYLD_LIBRARY_PATH, you can pass the
> GEOM
> >> > library path to the setup.py script (default is /usr/local/lib):
> >> > python setup.py build --with-geom-lib=/usr/local/lib/GEOM-5.1.2.7
> >> >
> >> > The setup.py script first looks for required library. You should have
> >> > something like:
> >> >
> >> > [snippet]
> >> > TKXSBase  ... found.
> >> > Checking salomegeometry GEOMAlgo_Algo.hxx header ... found
> >> > Checking salomegeometry GEOM library ... found
> >> > Checking salomesmesh SMESH_Mesh.hxx header ... found
> >> > Checking boost/shared_ptr.hpp header ... found
> >> > Checking salomesmesh SMESH library ... found
> >> > [/snippet]
> >> >
> >> > Thomas
> >> >
> >> >
> >> >
> >> > _______________________________________________
> >> > 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
> >
> >
>
> _______________________________________________
> 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

Reply via email to