-
Notifications
You must be signed in to change notification settings - Fork 45
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Methods that take a stream (ie DumpJson) don't work #53
Comments
Thanks for the links, looks like Standard_OStream is just a typedef and pybind has a pythonbuf class for this. I have two ideas, not sure which is best (or if they'll work):
Any preferences? I can try to make a patch. |
hmm....my first thought is 2....i think at the moment Standard_OStream is just skipped in the binder https://github.com/LaughlinResearch/pyOCCT/blob/1c354c2ffb92f5c49d0a4f1c7a26a6483c8b2b9f/binder/config.txt#L118 so, seems like if we just bind Standard_OStream...then we just create one in python and existing functions just work? and it follows the OCCT api. otherwise, #1 seems like a case that will require special logic in the binding generator to handle that type and writing the lambdas. which, we could do, but seems like 2 is worth a shot? |
In some cases these methods can write to a file so as a workaround I've created a temporary file, used OCCT to write to the file, and then read the file |
Did anything happen related to this issue since it was raised? I get similar issues. |
Seems that this gist provides a smooth and easy to integrate solution to this problem via custom type casting. |
I can confirm that the gist was the way to go, though for me it required some modifications: https://github.com/CadQuery/OCP/blob/master/pystreambuf.h |
I'm probably doing this wrong...
Expected Behavior
I think that should write to stdout
Current Behavior
Gives the error
Possible Solution
Does including the
<pybind11/stl.h>
make this work?The text was updated successfully, but these errors were encountered: