Hi Guillaume,

PythonOCC has a split personality; part of the project is very  
pythonic, which is the layer we build upon the wrappers.
The reason why the wrappers arent very pythonic is that we want the  
documentation of OCC to be valid for pythonOCC.

In [2]: api = StlAPI.StlAPI_Writer()

In [3]: api.
api.GetASCIIMode      api.__delattr__       api.__reduce_ex__
api.GetRelativeMode   api.__dict__          api.__repr__
api.SetASCIIMode      api.__doc__           api.__setattr__
api.SetCoefficient    api.__getattribute__  api.__str__
api.SetDeflection     api.__hash__          api.__weakref__
api.SetRelativeMode   api.__init__          api._kill_pointed
api.Write             api.__module__        api.this
api.__class__         api.__new__           api.thisown
api.__del__           api.__reduce__

In [3]: api.SetASCIIMode(False)

In [4]: api.GetASCIIMode()

Out[4]: 0

In [5]:

Welcome aboard!

-jelle

On Apr 8, 2010, at 3:02 PM, Guillaume Bouchard wrote:

> Hi,
>
> I just discovered python-occ (and occ) and life became much much  
> easier for me,
> I work every day with big STEP/IGES files and need to do some work  
> on them
> (convert them to triangles, ...).
>
> I have tried the StlAPI to convert a shape in STL file, this work  
> very well,
> but saves the STL file in ascii mode, which is good unless you have  
> VERY (VERY !)
> BIG (HUGE) file. To set the StlAPI to Binary mode, the C  
> documentation says [1] that
> StlAPI_Writer.ASCIIMode must be used, like that:
>
> w.ASCIIMode() # Get the value
> w.ASCIIMode() = false # Set the value.
>
> [1] 
> http://designfiles.org/lab/opencascade/occ6.3.0/doc/ReferenceDocumentation/DataExchange/html/classStlAPI__Writer.html#a7
>
> This is impossible in python because python does not accepts lvalue as
> expression.
>
> So, I have a C version like that, which work perfectly:
>
>  StlAPI_Writer api = StlAPI_Writer();
>  api.ASCIIMode() = false;
>  api.Write(shape, filename_out);
>
> And a python version like that:
>
>  api = StlAPI.StlAPI_Writer()
>  # api.ASCIIMode() = False
>  api.Write(shape, filename_out)
>
> How to remove the comment without triggering a SyntaxError ?
>
> Did I miss something easy ? Is this a binding issue ?
>
> Thank for your help.
>
> -- 
> Guillaume
>
> _______________________________________________
> 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