You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Have you found any solution for handling functions that return values via output parameters passed by reference, especially when those parameters are of immutable types?
This becomes a problem with important functions like BRep_Tool::CurveOnSurface. In such cases, the function modifies the arguments passed by reference (e.g., to return the first and last parameters of the Geom2d_Curve), but when these are immutable types in the binding language, we can’t retrieve the modified values.
This effectively blocks access to important return data.
The solution is to add workaround method in the binding manually or via rules. What is your use case (not CQ I presume) case and why is this function so important?
In some data science workflows involving BRep geometry, we need to work directly in the parametric (UV) domain of surfaces to perform calculations on faces. For instance, we often need to construct 2D edges and wires that represent the boundaries of a face in this parametric space.
To do this, it's essential to retrieve the associated pcurve and its parameter range. This also applies to vertices—sometimes we need to extract their (u, v) coordinates on a given surface to carry out specific operations.
Since this information is already available within the BRep data structures, it would be ideal to access it directly using functions like BRep_Tool::CurveOnSurface, rather than having to recompute or approximate it manually.
Hello,
Have you found any solution for handling functions that return values via output parameters passed by reference, especially when those parameters are of immutable types?
This becomes a problem with important functions like BRep_Tool::CurveOnSurface. In such cases, the function modifies the arguments passed by reference (e.g., to return the first and last parameters of the Geom2d_Curve), but when these are immutable types in the binding language, we can’t retrieve the modified values.
This effectively blocks access to important return data.
Some relevant references:
pybind11 FAQ – Limitations involving reference arguments
pyOCCT developer notes – Reference arguments
Would appreciate any guidance or workarounds!
Thanks in advance.
The text was updated successfully, but these errors were encountered: