Bug in BRepExtrema_DistShapeShape (through BRepExtrema_DistanceSS)

When computing the distance between a face or edge and a vertex, with the vertex as the second argument, PointOnShape1 and PointOnShape2 results are switched.

This seems to have been introduced in 6.5.1 and persists in 6.5.2. In 6.5.2, the lines 735 & 736 need to be changed from:
const BRepExtrema_SolutionElem Sol1(Dstmin,P1,BRepExtrema_IsOnEdge,S1,t);
const BRepExtrema_SolutionElem Sol2(Dstmin,Pt,BRepExtrema_IsVertex,S2);
to
const BRepExtrema_SolutionElem Sol1(Dstmin,Pt,BRepExtrema_IsOnEdge,S1,t);
const BRepExtrema_SolutionElem Sol2(Dstmin,P1,BRepExtrema_IsVertex,S2);

and lines 851 and 852 need to be changed from:
const BRepExtrema_SolutionElem Sol1(Dstmin,P1,BRepExtrema_IsInFace,S1,U,V);
const BRepExtrema_SolutionElem Sol2(Dstmin,Pt,BRepExtrema_IsVertex,S2);
to
const BRepExtrema_SolutionElem Sol1(Dstmin,Pt,BRepExtrema_IsInFace,S1,U,V);
const BRepExtrema_SolutionElem Sol2(Dstmin,P1,BRepExtrema_IsVertex,S2);

Forum supervisor's picture

Dear Rob,
I would like to inform you that the posted problem for edge has been already fixed in OCCT development version (issue ID=22758), and for the remaining problem (on face) we have registered a new issue with ID = 23051.
Regards