DiscussionsIssue archiveOCCT:Modeling Algorithms

Archived issue #0031942

Modeling Algorithms - add possibility to abort the BRepExtrema_DistShapeShape algorithm

Open CASCADEOCCT:Modeling Algorithmsclosed16 public notes

Search issues

Description

Algorithm works long in DMUReviewer application.

We'd like to give the user the possbibility to break the computations.

Optimization of the algorithm for the attached case is wellcome as well.

Steps to reproduce

Load the attached xbf model. It contains 2 shapes.
Call BRepExtrema_DistShapeShape algo for the imported shapes.

Perform() method takes ~ 7.09 secs. OSD_Timer is used to measure the time of algo work.

Additional information

System info:
OS Name Microsoft Windows 10 Pro
Version 10.0.17763 Build 17763
Processor Intel(R) Core(TM) i5-3470 CPU @ 3.20GHz, 3201 Mhz, 4 Core(s), 4 Logical Processor(s)
BIOS Version/Date American Megatrends Inc. 1301, 8/20/2013
Installed Physical Memory (RAM) 16.0 GB
Adapter Description NVIDIA GeForce GTS 450
Adapter RAM 1.00 GB (1,073,741,824 bytes)



Public activity

16 archived notes

Participants are labeled by their role within this record.

01Commenter 1
Estimate, please first and report me the expected time.
02Commenter 2
Branch [archived branch] has been created by Participant.

[revision removed]


Detailed log of new commits:

Author: asuraven
Date: Wed Aug 18 15:05:58 2021 +0300

    0031942: Modeling Algorithms - add possibility to abort the BRepExtrema_DistShapeShape algorithm
    
    - Now available to interrupt the DRAW 'distmini' command by Ctrl/C
    - Message_ProgressRange/Message_ProgressScope used in BRepExtrema_DistShapeShape::Perform() to provide user break
03Commenter 2
Branch [archived branch] has been updated forcibly by Participant.

[revision removed]
04Commenter 2
Branch [archived branch] has been updated forcibly by Participant.

[revision removed]
05Commenter 2
Branch [archived branch] has been updated forcibly by Participant.

[revision removed]
06Commenter 2
Branch [archived branch] has been updated forcibly by Participant.

[revision removed]
07Commenter 10
08Commenter 3
+  catch (StdFail_NotDone)

This would generate GCC/CLang warnings. Please do not catch exceptions by value.

Why exception is necessary here anyway - to reduce amount of code for checks?
Normally, progress abortion is handled without any exceptions.
09Commenter 12
    if (!aBoxScope.More())
    {
      throw StdFail_NotDone();
    }

I join the remark of Kirill. Please do abortion without throwing exceptions.

  Message_ProgressScope aTwinScope(theRange, NULL, 2);

You set proportion between the box pairs creation and distance calculations as 1:1. It will lead to non-smooth behavior of progress indicator. It is needed to conduct some experiments to know the real proportion. It may be something like 1:9 or so on.

  Message_ProgressScope aRootScope(theRange, "SolidTreatment", aRootStepsNum);

Why the root scope is named SolidTreatment? SolidTreatment is just one of steps.
10Commenter 2
Branch [archived branch] has been created by Participant.

[revision removed]


Detailed log of new commits:

Author: asuraven
Date: Wed Aug 18 15:05:58 2021 +0300

    0031942: Modeling Algorithms - add possibility to abort the BRepExtrema_DistShapeShape algorithm
    
    - Now available to interrupt the DRAW 'distmini' command by Ctrl/C
    - Message_ProgressRange/Message_ProgressScope used in BRepExtrema_DistShapeShape::Perform() to provide user break
11Commenter 14
remarks fixed in branch CR31942_1
12Commenter 15
13Commenter 16
For integration:

occt - CR31942_1
products - none
14Commenter 17
Combination -
OCCT branch : [archived branch]
master SHA - [revision removed]
[revision removed]
Products branch : [archived branch] SHA - [revision removed]
was compiled on Linux, MacOS and Windows platforms and tested in optimize mode.

Number of compiler warnings:
No new/fixed warnings

Regressions/Differences/Improvements:
No regressions/differences

CPU differences:
Debian80-64:
OCCT
Total CPU difference: 17495.94000000042 / 17441.55000000031 [+0.31%]
Products
Total CPU difference: 11565.440000000113 / 11534.270000000102 [+0.27%]
Windows-64-VC14:
OCCT
Total CPU difference: 19307.140625 / 19200.421875 [+0.56%]
Products
Total CPU difference: 12917.859375 / 12874.53125 [+0.34%]


Image differences :
No differences that require special attention

Memory differences :
No differences that require special attention
15Commenter 2
Branch [archived branch] has been deleted by Participant.

[revision removed]
16Commenter 2
Branch [archived branch] has been deleted by Participant.

[revision removed]

Related records