Wrong result of BRepExtrema_DistShapeShape after translation

Hello Guys,
I have strange result for a couple of shapes. Both of them were translated on some vector before BRepExtrema_DistShapeShape.

Please look at screenshot. First solid is white, the second solid is front "wall". Yellow vertices are result of algorithm. There are 8 vertices. And looks like there is phantom of white solid, shifted on some vector.

What could be the reason of so strange behavour?

Thanks.
With respects, Eugene.

Eugene Zaliznyak's picture

Original screenshot of situation.

Attachments: 
Artem Zhidkov's picture

Hello Eugene,

Could you attach original shapes? Or a simple reproducer script? There may be a problem in the input data as well as an error in BRepExtrema_DistShapeShape.

Regards,

Artem

Mikhail Sazonov's picture

Both description and snapshot are not understandable. And what relation BRepExtrema_DistShapeShape has to incorrect shapes and there visualization?

Eugene Zaliznyak's picture

Hello Guys,
First of all thank you an answers.
I am attaching BREP file with 2 solids. Actually, before translation of both solids on some same vector, the distance between these solids was calculated as 1mm. After translation algorithm calculates near 0.0 (1.20943e-14). And if we get points dist.PointOnShape1(i) and dist.PointOnShape2(i) it will provide completely wrong positions.

Thanks.
With respects, Eugene.

Attachments: 
Mikhail Sazonov's picture

This file is not a BREP file. How it was written? I cannot open it using OCCT.

Eugene Zaliznyak's picture

It is written in binary format by BinTools_ShapeWriter. Will you be able to read it by BinTools_ShapeReader or I should provide file in ascii mode ?

With respects, Eugene.

Mikhail Sazonov's picture

BinTools_ShapeWriter is internal tool and should not be used to save publicly distributable shapes. Please use BinTools::Write instead.

Eugene Zaliznyak's picture

Hello Mikhail,
I am attaching BREP file generated by BRepTools.

With respects, Eugene.

Attachments: 
Mikhail Sazonov's picture

I confirm that we have a problem with DistShapeShape algorithm. If we remove location of shapes the distance is calculated correctly.

Eugene, could you create a bug in mantis?

Eugene Zaliznyak's picture

Hello Mikhail,
What do you mean by remove location?
Is there any workaround for us for now?

Thank you.
With respects, Eugene.

Mikhail Sazonov's picture

If you just apply location to a shape it is written at the shape. Geometry remains untouched.

You can use the class BRepBuilderAPI_Transform to apply a transformation to the geometry of the shape.

There is the draw command removeloc, which gets rid of locations applying them to geometry.

Eugene Zaliznyak's picture

Thank you, Mikhail, it works.
How could I register bug in mantis ?

Mikhail Sazonov's picture

https://tracker.dev.opencascade.org/my_view_page.php

Report issue -> select category (Modeling Algorithms) -> describe and attach file.

Eugene Zaliznyak's picture

I have created the issue - https://tracker.dev.opencascade.org/view.php?id=32960

Thank you.
With respects, Eugene.