Hi Guillaume,

Welcome to you!

The OpenCASCADE API (C++) makes intensive use of references (these awful &).
The python wrapper applies a few transformations over methods that
take/return references to standard types liken integer, float etc.

If you're from the C++ world, I suggest you connect to
http://api.pythonocc.org to check the method prototype, and if there are any
modifications compared to the original C++ call.

These last few months, we fixed many of such issues, but it may remain a few
ones. Please report any misunderstood behaviour, and feel free to ask any
question on this ml.

Best Regards,

Thomas

2010/4/8 Guillaume Bouchard <[email protected]>

> 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
> [email protected]
> https://mail.gna.org/listinfo/pythonocc-users
>
_______________________________________________
Pythonocc-users mailing list
[email protected]
https://mail.gna.org/listinfo/pythonocc-users

Reply via email to