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

Reply via email to