BRepExtrema_DistShapeShape miss intersect point between two curve

Hello everyone, I would like to ask.
I use BRepExtrema_DistShapeShape to calculate the intersection point of two curves, but only one intersection point is obtained.
I tried two versions, 7.5.0 and 7.8.0, but could only get one intersection point.
But using BRepAlgoAPI_Section to process two curves, I can get two intersection points.
The attached picture shows the positions of the two curves,
the file in the attached compressed package is the problematic STP format model file.
Thank you all.

Attachments: 
Dmitrii Pasukhin's picture

Hello, could you send a code or DRAW sampe to reproduce to create a ticket? It makes faster the fix process.

Best regards, Dmitrii.

w d's picture

The sample code is as above, it is relatively simple, just call BRepExtrema_DistShapeShape, but there is only one solution, but from the picture, there are two, and two intersection points can be obtained through BRepAlgoAPI_Section.

BRepExtrema_DistShapeShape distShapeShape(shape1, shape2);
distShapeShape.Perform();
if (distShapeShape.IsDone()) {
int num = distShapeShape.NbSolution();
assert(num==2);
}

Thomas Anderson's picture

When I read the documentation on BRepExtrema_DistShapeShape::NbSolution(), I would expect one solution in your case.
"Returns the number of solutions satisfying the minimum distance."
Maybe try: BRepExtrema_ExtCC

w d's picture

I debugged it and found that during the process of calculating the closest distance, the distance between two groups of points was relatively small.

It was just that the distance between the missing group of points was on the order of 10-6, and the distance between the found group of points was 10-7.

The distance is orders of magnitude, and the reason for the loss is that in the math_GlobOptMin function, the step length is larger, causing the distance value to be missed.

So, even using BRepExtrema_ExtCC, only a set of points will be returned.

Therefore, I would like to ask if there is a way to ensure that these two sets of points are returned.

Thanks!