From 733824bffc7662a20b9db9c5dc03e75526316066 Mon Sep 17 00:00:00 2001 From: Christopher Lackner Date: Wed, 13 Oct 2021 16:54:23 +0200 Subject: [PATCH] Add Fuse operation for occ shapes --- libsrc/occ/python_occ_shapes.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/libsrc/occ/python_occ_shapes.cpp b/libsrc/occ/python_occ_shapes.cpp index 43dfbec8..03b0e902 100644 --- a/libsrc/occ/python_occ_shapes.cpp +++ b/libsrc/occ/python_occ_shapes.cpp @@ -1909,6 +1909,18 @@ DLL_HEADER void ExportNgOCCShapes(py::module &m) return builder.Shape(); }, py::arg("shape"), "glue together shapes from shape, typically a compound"); + m.def("Fuse", [](const vector& shapes) -> TopoDS_Shape + { + auto s = shapes[0]; + for(auto i : Range(size_t(1), shapes.size())) + { + BRepAlgoAPI_Fuse builder(s, shapes[i]); + PropagateProperties(builder, s); + PropagateProperties(builder, shapes[i]); + s = builder.Shape(); + } + return s; + }); // py::class_ (m, "Geom_TrimmedCurve")