mirror of
https://github.com/NGSolve/netgen.git
synced 2024-11-11 16:49:16 +05:00
fix occ - Nearest
This commit is contained in:
parent
74192981cf
commit
8dfdfb9579
@ -127,9 +127,11 @@ public:
|
||||
for (auto shape : *this)
|
||||
{
|
||||
double dist = BRepExtrema_DistShapeShape(shape, vertex).Value();
|
||||
// cout << "dist = " << dist << endl;
|
||||
if (dist < mindist)
|
||||
nearestshape = shape;
|
||||
{
|
||||
nearestshape = shape;
|
||||
mindist = dist;
|
||||
}
|
||||
}
|
||||
return nearestshape;
|
||||
}
|
||||
@ -1627,6 +1629,9 @@ DLL_HEADER void ExportNgOCCShapes(py::module &m)
|
||||
.def("Nearest", [] (ListOfShapes & shapes, gp_Pnt pnt)
|
||||
{ return CastShape(shapes.Nearest(pnt)); },
|
||||
py::arg("p"), "returns shape nearest to point 'p'")
|
||||
.def("Nearest", [] (ListOfShapes & shapes, gp_Pnt2d pnt)
|
||||
{ return CastShape(shapes.Nearest( { pnt.X(), pnt.Y(), 0 })); },
|
||||
py::arg("p"), "returns shape nearest to point 'p'")
|
||||
|
||||
.def_property("name", [](ListOfShapes& shapes)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user