Interoperability between a pybind11_type and its C++ equivalent #5110
Unanswered
GabrielJMS
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hello everyone,
First of all, thank you all for all the efforts put into this project!
To provide some context for my question, I have a Python SDK, and I'm exploring the possibility of integrating a C++ SDK. In summary, this C++ SDK includes a function that reads a CAD file and ultimately returns a TopoDS_Shape object, which is part of the OpenCASCADE C++ SDK. On the Python side, I'm utilizing the OCP Python wrapper of OpenCASCADE, which employs pybind11.
In this context, I'm interested in knowing if it's feasible to establish direct interoperability between the C++ TopoDS_Shape object and the pybind11-wrapped TopoDS_Shape object. In other words, I aim to create a pybind11 binding for this C++ function to enable its invocation from Python code and automatically generate an OCP pybind11 TopoDS_Shape object.
Is it possible to achieve such a binding? If yes, how can I accomplish this? Specifically, how can I manage the seamless conversion between the C++ TopoDS_Shape object and the OCP pybind11 TopoDS_Shape object? My first thoughts are if it would be possible to use the TopoDS_Shape from the OCP Python wrapper instead of the one from the OpenCASCADE C++ SDK in the C++ function side, so when I create the binding, it would return already the pybind11_type? How are the interoperability of standard types created? It would be possible to apply some similar approach to a nonstandard type as a TopoDS_Shape
Any insights or examples on this matter would be highly appreciated!
Thank you very much for the attention
Beta Was this translation helpful? Give feedback.
All reactions