TopoShapePy: add optional tolerance to function distToShape

This commit is contained in:
tomate44
2024-03-25 17:12:44 +01:00
committed by wwmayer
parent 1eea88a8b7
commit 5603c697d0
2 changed files with 4 additions and 2 deletions

View File

@@ -2605,8 +2605,9 @@ PyObject* TopoShapePy::distToShape(PyObject *args)
BRepExtrema_SupportType supportType1, supportType2;
TopoDS_Shape suppS1, suppS2;
Standard_Real minDist = -1, t1, t2, u1, v1, u2, v2;
Standard_Real tol = Precision::Confusion();
if (!PyArg_ParseTuple(args, "O!",&(TopoShapePy::Type), &ps2))
if (!PyArg_ParseTuple(args, "O!|d",&(TopoShapePy::Type), &ps2, &tol))
return nullptr;
const TopoDS_Shape& s1 = getTopoShapePtr()->getShape();
@@ -2619,6 +2620,7 @@ PyObject* TopoShapePy::distToShape(PyObject *args)
return nullptr;
}
BRepExtrema_DistShapeShape extss;
extss.SetDeflection(tol);
extss.LoadS1(s1);
extss.LoadS2(s2);
try {