Merge branch 'limit_shape_tolerances' into 'master'

allow limiting of shape tolerances

See merge request ngsolve/netgen!706
This commit is contained in:
Lackner, Christopher 2025-05-12 11:37:56 +02:00
commit 421c10b1af

View File

@ -76,6 +76,7 @@
#include <IntTools_Context.hxx> #include <IntTools_Context.hxx>
#include <ShapeAnalysis_FreeBounds.hxx> #include <ShapeAnalysis_FreeBounds.hxx>
#include <ShapeUpgrade_UnifySameDomain.hxx> #include <ShapeUpgrade_UnifySameDomain.hxx>
#include <ShapeFix_ShapeTolerance.hxx>
#include <gp_Ax1.hxx> #include <gp_Ax1.hxx>
#include <gp_Ax2.hxx> #include <gp_Ax2.hxx>
#include <gp_Ax2d.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()) ); return py::make_tuple( ng2occ(box.PMin()), ng2occ(box.PMax()) );
}, "returns bounding box (pmin, 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) .def("Properties", [] (const TopoDS_Shape & shape)
{ {
auto props = Properties(shape); auto props = Properties(shape);