From 9399f753c41faa4feaea502aa3383414f41f0749 Mon Sep 17 00:00:00 2001 From: Christopher Lackner Date: Fri, 14 Mar 2025 11:36:00 +0100 Subject: [PATCH] allow list of profiles in PipeShell --- libsrc/occ/python_occ_shapes.cpp | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/libsrc/occ/python_occ_shapes.cpp b/libsrc/occ/python_occ_shapes.cpp index 9c645a37..77119135 100644 --- a/libsrc/occ/python_occ_shapes.cpp +++ b/libsrc/occ/python_occ_shapes.cpp @@ -2046,14 +2046,19 @@ DLL_HEADER void ExportNgOCCShapes(py::module &m) return BRepOffsetAPI_MakePipe (spine, profile).Shape(); }, py::arg("spine"), py::arg("profile"), py::arg("twist")=nullopt, py::arg("auxspine")=nullopt); - m.def("PipeShell", [] (const TopoDS_Wire & spine, const TopoDS_Shape & profile, const TopoDS_Wire & auxspine) { + m.def("PipeShell", [] (const TopoDS_Wire & spine, variant> profile, std::optional auxspine) { try { BRepOffsetAPI_MakePipeShell builder(spine); - builder.SetMode (auxspine, Standard_True); - builder.Add (profile); - // builder.Build(); - // builder.MakeSolid(); + if(auxspine) + builder.SetMode (*auxspine, Standard_True); + if(std::holds_alternative(profile)) + builder.Add (std::get(profile)); + else + { + for(auto s : std::get>(profile)) + builder.Add(s); + } return builder.Shape(); } catch (Standard_Failure & e) @@ -2062,7 +2067,7 @@ DLL_HEADER void ExportNgOCCShapes(py::module &m) e.Print(errstr); throw NgException("cannot create PipeShell: "+errstr.str()); } - }, py::arg("spine"), py::arg("profile"), py::arg("auxspine")); + }, py::arg("spine"), py::arg("profile"), py::arg("auxspine")=nullopt); // Handle(Geom2d_Ellipse) anEllipse1 = new Geom2d_Ellipse(anAx2d, aMajor, aMinor);