From 767dd996e837e5037553414c7ade2db073244d27 Mon Sep 17 00:00:00 2001 From: Christopher Lackner Date: Mon, 12 May 2025 11:17:00 +0200 Subject: [PATCH] allow limiting of shape tolerances --- libsrc/occ/python_occ_shapes.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/libsrc/occ/python_occ_shapes.cpp b/libsrc/occ/python_occ_shapes.cpp index 795a7947..553a835f 100644 --- a/libsrc/occ/python_occ_shapes.cpp +++ b/libsrc/occ/python_occ_shapes.cpp @@ -76,6 +76,7 @@ #include #include #include +#include #include #include #include @@ -775,6 +776,14 @@ DLL_HEADER void ExportNgOCCShapes(py::module &m) return py::make_tuple( ng2occ(box.PMin()), ng2occ(box.PMax()) ); }, "returns bounding box (pmin, pmax)") + .def("LimitTolerance", [](TopoDS_Shape& self, double tmin, + double tmax, TopAbs_ShapeEnum type) + { + ShapeFix_ShapeTolerance fix; + fix.LimitTolerance(self, tmin, tmax, type); + }, py::arg("tmin"), py::arg("tmax")=0., py::arg("type")=TopAbs_SHAPE, + "limit tolerance of shape to range [tmin, tmax]") + .def("Properties", [] (const TopoDS_Shape & shape) { auto props = Properties(shape);