From 378152d1c43436fb86f6b21e9f9bec0bb00b4c79 Mon Sep 17 00:00:00 2001 From: Christopher Lackner Date: Tue, 30 Nov 2021 17:45:52 +0100 Subject: [PATCH] [occ] add Distance of shapes --- libsrc/occ/python_occ_shapes.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/libsrc/occ/python_occ_shapes.cpp b/libsrc/occ/python_occ_shapes.cpp index 3d3b21dd..fe84b65c 100644 --- a/libsrc/occ/python_occ_shapes.cpp +++ b/libsrc/occ/python_occ_shapes.cpp @@ -21,6 +21,7 @@ #include #include #include +#include #include #include #include @@ -1018,6 +1019,12 @@ DLL_HEADER void ExportNgOCCShapes(py::module &m) .def("Identify", OCCGeometry::IdentifyFaces, "Identify faces", py::arg("from"), py::arg("to"), py::arg("name"), py::arg("type")=Identifications::PERIODIC) + + .def("Distance", [](const TopoDS_Shape& self, + const TopoDS_Shape& other) + { + return BRepExtrema_DistShapeShape(self, other).Value(); + }) .def("Triangulation", [](const TopoDS_Shape & shape) {