DiscussionsIssue archiveOCCT:Modeling Algorithms

Archived issue #0026244

Destructive results of simplification with DRAW command 'unifysamedom' after intersection of two complex models

Open CASCADEOCCT:Modeling Algorithmsclosed18 public notes

Search issues

Description

There is attached script which builds complex model.
We try to apply some Boolean operations on this model and its rotated copy.
Boolean operation 'bcommon' gives a valid shape (by 'checkshape') with normal tolerance. But after the simplification 'unifysamedom' was called, shape has became invalid. Moreover, some constructive elements, like holes, disappeared and a maximal tolerance has became > 187.

Steps to reproduce

source Attachment 3 (TCL)
tcopy _model _copy
trotate _copy $aWedgeHoleXPos $aWedgeHoleYPos 0 0 0 1 90
bcommon res _model _copy
checkshape res
unifysamedom res res

Additional information

Another bug on Boolean operations with same model with fillets:
#0026243

Public activity

18 archived notes

Participants are labeled by their role within this record.

01Commenter 1
I obtain StdFail_NotDone exception on the provided case (MSVC 2013, x64): no result (even faulty) of unifysamedom is available.
02Commenter 2
Branch [archived branch] has been created by Participant.

[revision removed]


Detailed log of new commits:

Author: isn
Date: Wed Aug 26 14:48:37 2015 +0300

    0026244: Destructive results of simplification with DRAW command 'unifysamedom' after intersection of two complex models
03Commenter 3
This problem cannot be reproduced on the current version (i.e. checkshape is not giving any faulty shapes), but there is another problem with triangulation (Attachment 4 (PNG)):
---
source Attachment 3 (TCL)
tcopy _model _copy
trotate _copy $aWedgeHoleXPos $aWedgeHoleYPos 0 0 0 1 90
bcommon res _model _copy
checkshape res
unifysamedom r res
incmesh r 0.1
trinfo r

As a result of last command, "Maximal deflection" will be > 50 which seems to be wrong.

fix in the branch CR26244 should eliminate this problem. ##(Attachment 1 (PNG))

04Commenter 4
The code in lines 629-660 must be rewritten:
1) aChain(i - 1) can raise exception when i==1.
2) Do not return false if no vertices to avoid are found.
3) Make edge in different way depending on whether we use the existing circle or create a new one. In the last case new edge must be left Forward, and vertex V1 added there two times with different orientation.
05Commenter 5
the new branch is CR26244_1;
(circles only)
please check.

06Commenter 2
Branch [archived branch] has been created by Participant.

[revision removed]


Detailed log of new commits:

Author: isn
Date: Mon Aug 31 17:37:38 2015 +0300

    unifysamedom :: problem with triangulation
07Commenter 2
Branch [archived branch] has been updated forcibly by Participant.

[revision removed]
08Commenter 8
Please simplify the fix as we agreed.
09Commenter 9
And, please re-base on current master.
10Commenter 2
Branch [archived branch] has been updated forcibly by Participant.

[revision removed]
11Commenter 11
done
12Commenter 12
Remarks:

- MC is used in 'else' scope of next 'if', so it is better to declare it there:
622: GC_MakeCircle MC (PV1,PVM,PV2);

- This is extra, because V1.IsSame.(V2):
626: if (PV1.Distance(PV2) > Precision::Confusion())

- Remove commented code, to make it clear:
624: if (/*!MC.IsDone() || MC.Value().IsNull()*/ V1.IsSame(V2)) {

- Move definitions of PV1, PV2, VM, PVM to the scope where they are used.

- Though the following record looks compact, it involves the same comparison two times. It is better to write direct 'if...else' statements:
632: FP = FE.Orientation() == TopAbs_FORWARD ? adef.FirstParameter() : adef.LastParameter();
633: LP = FE.Orientation() == TopAbs_FORWARD ? adef.LastParameter() : adef.FirstParameter();

- The following condition is erroneous, because FP can be negative, use Abs():
634: if (FP < Precision::PConfusion())

- In the line 643, simplify expression 'FP + (LP - FP) / 2.' to '(FP + LP) * 0.5'

- As we know that V1.IsSame(V2) and they have different orientation, in the following statement we can use just V2:
650: B.Add(E,V1.Reversed());
13Commenter 2
Branch [archived branch] has been updated by Participant.

[revision removed]


Detailed log of new commits:

Author: isn
Date: Wed Sep 2 12:05:56 2015 +0300

    corrections

14Commenter 14
Reviewed.
15Commenter 2
Branch [archived branch] has been updated by Participant.

[revision removed]


Detailed log of new commits:

Author: mkv
Date: Thu Sep 3 13:02:41 2015 +0300

    Test case for issue CR26244

16Commenter 16
Dear Commenter 1,
Branch CR26244_1 from occt git-repository (and master from products git-repository) was compiled on Linux, MacOS and Windows platforms and tested on Release mode.
[revision removed]

Number of compiler warnings:

occt component :
Linux: 15 (15 on master)
Windows: 0 (0 on master)

products component :
Linux: 39 (39 on master)
Windows: 0 (0 on master)

Regressions/Differences/Improvements:
No regressions/differences

Testing cases:
http://occt-tests/CR26244-1-master-occt-64/Debian70-64/bugs/heal/bug26244.html
http://occt-tests/CR26244-1-master-occt-64/Windows-64-VC10/bugs/heal/bug26244.html
bugs heal bug26244: OK

Testing on Linux:
occt component :
Total MEMORY difference: 91785433 / 91192751 [+0.65%]
Total CPU difference: 17761.219999998815 / 17162.109999999382 [+3.49%]
products component :
Total MEMORY difference: 25202742 / 25221023 [-0.07%]
Total CPU difference: 7288.749999999995 / 7038.589999999997 [+3.55%]

Testing on Windows:
occt component :
Total MEMORY difference: 57098781 / 57090163 [+0.02%]
Total CPU difference: 16400.71273209907 / 16439.978183798914 [-0.24%]
products component :
Total MEMORY difference: 16223023 / 16222282 [+0.00%]
Total CPU difference: 5268.746573799948 / 5332.831784599964 [-1.20%]

There are no differences in images found by testdiff.
17Commenter 2
Branch [archived branch] has been deleted by Participant.

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

[revision removed]

Related records