From 0862327937bb7682d665105405c3376e0302b14d Mon Sep 17 00:00:00 2001 From: Joachim Schoeberl Date: Tue, 28 Sep 2021 19:34:43 +0200 Subject: [PATCH] wrapping shape.MakeChamfer --- libsrc/occ/python_occ_shapes.cpp | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/libsrc/occ/python_occ_shapes.cpp b/libsrc/occ/python_occ_shapes.cpp index f4b0061c..cae7b0bf 100644 --- a/libsrc/occ/python_occ_shapes.cpp +++ b/libsrc/occ/python_occ_shapes.cpp @@ -39,6 +39,7 @@ #include #include #include +#include #include #include #include @@ -1064,13 +1065,6 @@ DLL_HEADER void ExportNgOCCShapes(py::module &m) // throw Exception("no face found for revolve"); }, py::arg("axis"), py::arg("ang"), "revolve shape around 'axis' by 'ang' degrees") - .def("Find", [](const TopoDS_Shape & shape, gp_Pnt p) - { - throw Exception ("not implemented yet"); - // find sub-shape contianing point - // BRepClass_FaceClassifier::Perform (p); - }, py::arg("p"), "finds sub-shape containing point 'p' (not yet implemented)") - .def("MakeFillet", [](const TopoDS_Shape & shape, std::vector edges, double r) { BRepFilletAPI_MakeFillet mkFillet(shape); for (auto e : edges) @@ -1078,6 +1072,13 @@ DLL_HEADER void ExportNgOCCShapes(py::module &m) return mkFillet.Shape(); }, py::arg("edges"), py::arg("r"), "make fillets for edges 'edges' of radius 'r'") + .def("MakeChamfer", [](const TopoDS_Shape & shape, std::vector edges, double d) { + BRepFilletAPI_MakeChamfer mkChamfer(shape); + for (auto e : edges) + mkChamfer.Add (d, TopoDS::Edge(e)); + return mkChamfer.Shape(); + }, py::arg("edges"), py::arg("d"), "make symmetric chamfer for edges 'edges' of distrance 'd'") + .def("MakeThickSolid", [](const TopoDS_Shape & body, std::vector facestoremove, double offset, double tol) { TopTools_ListOfShape faces; @@ -1955,7 +1956,7 @@ DLL_HEADER void ExportNgOCCShapes(py::module &m) mkFillet.Add (r, TopoDS::Edge(e)); return mkFillet.Shape(); }, "deprecated, use 'shape.MakeFillet'"); - + m.def("MakeThickSolid", [](TopoDS_Shape body, std::vector facestoremove, double offset, double tol) { throw Exception("call 'shape.MakeThickSolid'");