CadQuery / CadQuery/OCP

Solution to functions that tries modifying immutable arguments passed by reference

Open
#167 5 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
197
Forks
47
Avg merge
2d 2h
Merged PRs (30d)
6

Description

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](https://dev.opencascade.org/doc/occt-7.2.0/refman/html/class_b_rep___tool.html#aeaa70c29f0a30d827fd8a36116d74b91). 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](https://pybind11.readthedocs.io/en/stable/faq.html#limitations-involving-reference-arguments)

[pyOCCT developer notes – Reference arguments](https://pyocct.readthedocs.io/en/latest/dev.html#reference-arguments)

Would appreciate any guidance or workarounds!

Thanks in advance.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.