Forum archiveIssue archiveModeling Data and Algorithms

Archived discussion

Wrong result of BRepExtrema_DistShapeShape after translation

Modeling Data and AlgorithmsSat, 04/23/2022 - 19:1114 replies

Browse this forum
QuestionAuthor

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, Author.

Discussion

14 archived replies

Posts are displayed in their archived order.

01Author

Original screenshot of situation.

02Commenter-1

Hello Author,

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,

Commenter-1

03Commenter-2

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

04Author

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, Author.

05Commenter-2

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

06Author

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, Author.

07Commenter-2

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

08Author

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

With respects, Author.

09Commenter-2

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

Author, could you create a bug in mantis?

10Author

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

Thank you.
With respects, Author.

11Commenter-2

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.

12Author

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

13Commenter-2

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

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

14Author

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

Thank you.
With respects, Author.