CadQuery / CadQuery/OCP

Solution to functions that tries modifying immutable arguments passed by reference

Đang mở
#167 5 bình luận 0 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
C++
Star
197
Fork
47
Merge trung bình
2 ngày 2 giờ
Pull request đã merge (30 ngày)
6

Mô tả

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.

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Hướng nghiên cứu

Bắt đầu với BRep_Tool::CurveOnSurface và xem lại pybind11 FAQ được liên kết cùng các ghi chú dành cho nhà phát triển pyOCCT về các đối số tham chiếu. Xác định phạm vi cần thiết ở cấp binding để cung cấp các tham số đầu và cuối đã được sửa đổi của đường cong, sau đó xác minh rằng các bên gọi có thể lấy lại các giá trị đó.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
cpp, python
Lĩnh vực
api
Loại issue
Tính năng
Độ khó
5/5
Thời gian dự kiến
Hơn một tuần
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Cần làm rõ
Mức phù hợp với người mới
25/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.