[occ] add Distance of shapes

This commit is contained in:
Christopher Lackner 2021-11-30 17:45:52 +01:00
parent 8626262679
commit 378152d1c4

View File

@ -21,6 +21,7 @@
#include <BRepBuilderAPI_MakeVertex.hxx> #include <BRepBuilderAPI_MakeVertex.hxx>
#include <BRepBuilderAPI_MakeWire.hxx> #include <BRepBuilderAPI_MakeWire.hxx>
#include <BRepBuilderAPI_Transform.hxx> #include <BRepBuilderAPI_Transform.hxx>
#include <BRepExtrema_DistShapeShape.hxx>
#include <BRepFilletAPI_MakeChamfer.hxx> #include <BRepFilletAPI_MakeChamfer.hxx>
#include <BRepFilletAPI_MakeFillet.hxx> #include <BRepFilletAPI_MakeFillet.hxx>
#include <BRepGProp.hxx> #include <BRepGProp.hxx>
@ -1019,6 +1020,12 @@ DLL_HEADER void ExportNgOCCShapes(py::module &m)
.def("Identify", OCCGeometry::IdentifyFaces, "Identify faces", .def("Identify", OCCGeometry::IdentifyFaces, "Identify faces",
py::arg("from"), py::arg("to"), py::arg("name"), py::arg("type")=Identifications::PERIODIC) 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) .def("Triangulation", [](const TopoDS_Shape & shape)
{ {
// extracted from vsocc.cpp // extracted from vsocc.cpp