wrapping shape.MakeChamfer

This commit is contained in:
Joachim Schoeberl 2021-09-28 19:34:43 +02:00
parent 968658a70e
commit 0862327937

View File

@ -39,6 +39,7 @@
#include <BRepBuilderAPI_Transform.hxx> #include <BRepBuilderAPI_Transform.hxx>
#include <BRepBuilderAPI_MakeFace.hxx> #include <BRepBuilderAPI_MakeFace.hxx>
#include <BRepFilletAPI_MakeFillet.hxx> #include <BRepFilletAPI_MakeFillet.hxx>
#include <BRepFilletAPI_MakeChamfer.hxx>
#include <BRepOffsetAPI_ThruSections.hxx> #include <BRepOffsetAPI_ThruSections.hxx>
#include <BRepOffsetAPI_MakeOffset.hxx> #include <BRepOffsetAPI_MakeOffset.hxx>
#include <BRepExtrema_DistShapeShape.hxx> #include <BRepExtrema_DistShapeShape.hxx>
@ -1064,13 +1065,6 @@ DLL_HEADER void ExportNgOCCShapes(py::module &m)
// throw Exception("no face found for revolve"); // throw Exception("no face found for revolve");
}, py::arg("axis"), py::arg("ang"), "revolve shape around 'axis' by 'ang' degrees") }, 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<TopoDS_Shape> edges, double r) { .def("MakeFillet", [](const TopoDS_Shape & shape, std::vector<TopoDS_Shape> edges, double r) {
BRepFilletAPI_MakeFillet mkFillet(shape); BRepFilletAPI_MakeFillet mkFillet(shape);
for (auto e : edges) for (auto e : edges)
@ -1078,6 +1072,13 @@ DLL_HEADER void ExportNgOCCShapes(py::module &m)
return mkFillet.Shape(); return mkFillet.Shape();
}, py::arg("edges"), py::arg("r"), "make fillets for edges 'edges' of radius 'r'") }, py::arg("edges"), py::arg("r"), "make fillets for edges 'edges' of radius 'r'")
.def("MakeChamfer", [](const TopoDS_Shape & shape, std::vector<TopoDS_Shape> 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<TopoDS_Shape> facestoremove, .def("MakeThickSolid", [](const TopoDS_Shape & body, std::vector<TopoDS_Shape> facestoremove,
double offset, double tol) { double offset, double tol) {
TopTools_ListOfShape faces; TopTools_ListOfShape faces;