Hello,

Here is another issue I'm working on these days: current available 
releases are 'monolithic' build, that is to say a single _OCC.pyd 
(Windows) or _OCC.so (Linux) file that contains all pythonOCC classes.

This causes a lots of issues:
- the C++ file to compile is huge (almost 120Mb). Compilation of the 
complete pythonOCC wrapper is impossible on Linux (tested with Ubuntu 
8.04 and Fedora 9) and my Windows system is about to collapse.
- the resulting shared library is big (50Mb)
- if you want to use a few pythonOCC classes, you have to import 
everything, causing a big memory footprint.

There is another possible way: a 'modular' build that would be such as:
- one shared library (from 1 to 5Mb) per OCC package: _gp.so, 
_Precision.so, _Geom.so etc.
- a set of 'smalls' (from 1 to 5Mb) C++ file to compile
- an easy Linux and Windows built that could lead pythonOCC to cover the 
all OpenCascade classes in a short term.
- just import what you need when working with pythonOCC.

SVN rev. 328 allows you to choose the way you want to build pythonOCC:
Monolithic: python setup.py build -cmsvc generate_swig_monolithic 
(remove -cmsvc under Linux)
Modular: python setup.py build -cmsvc generate_swig_modular

I face now another issue: it can occurs that a method returns an object 
that is not in Python namespace. For instance,if you do:

> >Import BRepPrimAPI
> >cyl = BRepPrimAPI.BRepPrimAPI_MakeCylinder(50,200)
> >print cyl.Shape()
> > <Swig Object of type ‘TopoDS_Shape *’ at 0xa5d504>

You cannot access the TopoDS_Shape methods untill you manually import 
the TopoDS module. How could I automate the import of this module? I 
heard of the ITK 'lazy import' solution 
(http://voxel.jouy.inra.fr/darcs/contrib-itk/WrapITK-unstable/Languages/Python/itk.py)
 
but I do not really understand it.

Is there any python 'lazy import' skill on the list? Do you have any 
other suggestion?

Regards,

Thomas

_______________________________________________
Minerva-pythonocc mailing list
Minerva-pythonocc@gna.org
https://mail.gna.org/listinfo/minerva-pythonocc

Reply via email to