allow limiting of shape tolerances

This commit is contained in:
Christopher Lackner 2025-05-12 11:17:00 +02:00
parent a9e8f2a1c9
commit 767dd996e8

View File

@ -76,6 +76,7 @@
#include <IntTools_Context.hxx>
#include <ShapeAnalysis_FreeBounds.hxx>
#include <ShapeUpgrade_UnifySameDomain.hxx>
#include <ShapeFix_ShapeTolerance.hxx>
#include <gp_Ax1.hxx>
#include <gp_Ax2.hxx>
#include <gp_Ax2d.hxx>
@ -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);