2010/7/6 Guillaume Bouchard <guillaume.bouch...@insa-lyon.fr>

> Hello,
>
> Sorry for the lag between your answer and my.
>
> On Mon, Jun 28, 2010 at 09:52:40PM +0200, Thomas Paviot wrote:
> > Do  API Reference available at: http://api.pythonocc.org
> >
> > The methods available from the StlAPI_Writer class, useful to customize
> the
> > generated STL files are SetDeflection() (default is 0.01) and
> > SetCoefficient() (default is 0.001) (documentation:
> > http://api.pythonocc.org/OCC.StlAPI.StlAPI_Writer-class.html).
>
> Am I missing something ? Or the so-called documentation does not gives a
> clue
> about what are the parameters ? (it is not a rant about the documentation,
> I
> know that writing documentation is hard, boring and difficult ;) Currently
> It
> is like "Call theses functions with a random value and guess why this
> change
> something."
>

We do not aim at replacing the OpenCascade team. It is out of our objectives
to write a documentation of the OpenCascade kernel. It's the OCC team job!
Here is out you should process if you want to deeply understand what
happens:

1. Read the OCC documentation
2. Read the OCC headers (*.hxx files) to get documentation:

snippet from StlAPI_Writer.hxx:
"""
//! Sets the deflection of the meshing algorithm. <br>
//!    Deflection is used, only if relative mode is false <br>
Standard_EXPORT   void SetDeflection(const Standard_Real aDeflection) ;

//! Sets the coeffiecient for computation of deflection through <br>
//!          relative size of shape. Default value = 0.001 <br>
Standard_EXPORT   void SetCoefficient(const Standard_Real aCoefficient) ;
"""

When I started to work on the wrapper, I created a script that extracts the
docstrings from these headers and convert them to python docstings (you can
access with help(somehting) or something.__doc__). But this way to proceed
raises licensing issues: if I include original code from OCC into the python
wrapper, then pythonOCC falls under the terms of the OCCT public license.

3. Study the C++ code. For instance, the algorithmic part of the Stl meshing
is available in the file named StlTransfer.cxx (it's the method named
BuildIncrementalMesh).


>
> > The algorithm used to generate files is quite simple. You might have a
> look
> > at the MEFISTO2 mesher, that creates homogeneous triangles. But you will
> > have to write the STL exporter by yourself (in ASCII mode, it's not very
> > difficult). Have a look at the surfacig_mesh.py sample (
> >
> http://code.google.com/p/pythonocc/source/browse/trunk/src/examples/Level1/SMESH/surfacic_mesh.py
> ).
>
> Nice example. I have issues importing OCC.SMESH and OCC.StdMeshers with the
> ubuntu pythonocc package available for ubuntu, I'll try tomorrow to use the
> pythonocc from source, but I hate when it comes to compilation ;)
>

SMESH and GEOM modules were not packaged by the ubuntu packagers. I recently
improved the way to build these libraries in order to make packaging easier.
This will be available in the next release. In the meantime, I suggest you
compile your own pythonocc from the subversion trunk.


> Thank you for your help.
>

You're welcome,


>
> --
> Guillaume
>

Thomas
_______________________________________________
Pythonocc-users mailing list
Pythonocc-users@gna.org
https://mail.gna.org/listinfo/pythonocc-users

Reply via email to