From 4c39979da302d884716e3aee6726848b7fe50ae8 Mon Sep 17 00:00:00 2001 From: Gabriel Date: Wed, 17 Jun 2026 23:07:22 +0200 Subject: [PATCH] Add BRep_Tool.CurveOnSurface_r returning (pcurve, first, last) (#167) CurveOnSurface returns a non-void Handle and reports its parameter range through Standard_Real& reference args, which are unreachable from Python (pybind11 cannot write back immutable types). The existing call-by-reference tuple mechanism only triggers for void-returning methods, so this case is missed. Add a targeted, non-breaking workaround via the rules mechanism: a new static method CurveOnSurface_r(E, F) that returns (pcurve, first, last). The original CurveOnSurface_s binding is left untouched. Co-Authored-By: Claude Opus 4.8 (1M context) --- ocp.toml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/ocp.toml b/ocp.toml index ce5a38533..dd5f1a29b 100644 --- a/ocp.toml +++ b/ocp.toml @@ -569,6 +569,14 @@ py::implicitly_convertible();""" exclude_typedefs = ["IntPolyh_ArrayOfEdges","IntPolyh_ArrayOfTriangles","IntPolyh_ArrayOfPointNormal","IntPolyh_ArrayOfSectionLines","IntPolyh","IntPolyh_ArrayOfTangentZones","IntPolyh_ArrayOfPoints"] + [Modules.BRep] + + [Modules.BRep.Classes.BRep_Tool.additional_static_methods.CurveOnSurface_r] + + body = "[](const TopoDS_Edge& E, const TopoDS_Face& F){ Standard_Real first, last; auto curve = BRep_Tool::CurveOnSurface(E, F, first, last); return std::make_tuple(curve, first, last); }" + help = "Returns (pcurve, first, last): the 2D curve of edge E on face F and its parameter range." + arguments = ["E", "F"] + [Modules.BRepBuilderAPI] exclude_typedefs = ["BRepBuilderAPI_CellFilter","BRepBuilderAPI_BndBoxTree"]