From 8374346023671ea9914e27f5569962297d475e41 Mon Sep 17 00:00:00 2001 From: Christopher Lackner Date: Mon, 22 May 2023 13:08:31 +0200 Subject: [PATCH] allow adding identification name in occ extrude --- libsrc/occ/python_occ_shapes.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/libsrc/occ/python_occ_shapes.cpp b/libsrc/occ/python_occ_shapes.cpp index 641a2213..b66fcdcd 100644 --- a/libsrc/occ/python_occ_shapes.cpp +++ b/libsrc/occ/python_occ_shapes.cpp @@ -983,7 +983,8 @@ DLL_HEADER void ExportNgOCCShapes(py::module &m) .def("Extrude", [](const TopoDS_Shape & shape, double h, optional dir, bool identify, - Identifications::ID_TYPE idtype) + Identifications::ID_TYPE idtype, + string idname) { for (TopExp_Explorer e(shape, TopAbs_FACE); e.More(); e.Next()) { @@ -1011,13 +1012,15 @@ DLL_HEADER void ExportNgOCCShapes(py::module &m) { Transformation<3> trsf(h * occ2ng(edir)); Identify(GetFaces(shape), GetFaces(builder.LastShape()), - "extrusion_cs", idtype, trsf); + idname, idtype, trsf); } return builder.Shape(); } throw Exception("no face found for extrusion"); }, py::arg("h"), py::arg("dir")=nullopt, py::arg("identify")=false, - py::arg("idtype")=Identifications::CLOSESURFACES, "extrude shape to thickness 'h', shape must contain a plane surface, optionally give an extrusion direction") + py::arg("idtype")=Identifications::CLOSESURFACES, + py::arg("idname") = "extrusion", + "extrude shape to thickness 'h', shape must contain a plane surface, optionally give an extrusion direction") .def("Extrude", [] (const TopoDS_Shape & face, gp_Vec vec) { return BRepPrimAPI_MakePrism (face, vec).Shape();