MantisBT
Mantis Bug Tracker Workflow

View Issue Details Jump to Notes ] Related Changesets ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0031974Community[OCCT] OCCT:Modeling Algorithmspublic2020-12-03 12:212021-02-21 11:44
Reportergeuzaine 
Assigned Tobugmaster 
PrioritynormalSeverityminor 
StatusverifiedResolutionfixed 
PlatformMacOSOSOS VersionX
Product Version[OCCT] 7.5.0 
Target Version[OCCT] 7.6.0*Fixed in Version 
Summary0031974: Modeling Algorithms - Strange behavior of boolean operations on this BREP
DescriptionDear OCCT team,

I obtain strange results when I apply boolean operations between the two solids (an ellipsoid and a cube) contained in the attached BREP file (test.brep).

Could you check on your side if the BREP is somehow incorrect (inverted solid?...)? What's puzzling is that if the ellipsoid is moved to another location, everything behaves as expected.

Here are two screenshots of the behavior of BRepAlgoAPI_Cut applied to the cube and the ellipsoid:

https://gmsh.info/beta/before_cut.png [^]
https://gmsh.info/beta/after_cut.png [^]

Somehow the cutting leaves the imprint of the ellipsoid in the cube, but does not carve out the part.

Thanks,

Christophe
Steps To Reproducerestore test.brep t
explode t
bclearobjects
bcleartools
baddobjects t_1
baddtools t_2
bfillds
bbuild r
TagsNo tags attached.
Test case numberbugs/modalg_7/bug31974
Attached Files? file icon test.brep (62,609 bytes) 2020-12-03 12:21
png file icon AABB_inv.png (5,244 bytes) 2020-12-03 17:06
? file icon fx.brep (9,312 bytes) 2020-12-04 08:29

- Relationships
parent of 0031995verifiedbugmaster Open CASCADE Modeling Data - Bounding box is wrong for face 

-  Notes
(0097270)
abv (manager)
2020-12-03 13:07

Eugene, can you please have a look at this issue?
(0097275)
emv (developer)
2020-12-03 17:06

For some reason bounding box of one of the splits of the ellipsoid face is invalid, it does not contain the face. Here is the Draw script to reproduce (picture is attached):
restore test.brep t
explode t
bclearobjects
bcleartools
baddobjects t_1
baddtools t_2
bfillds
bbuild r

explode t_2 f
bopim t_2_1
explode t_2_1_im
copy t_2_1_im_3 fx
donly fx
bounding fx -shape bb
vdisplay fx bb


To be investigated further.
(0097294)
emv (developer)
2020-12-04 08:30

Igor, could you please take a look why AABB is wrong? Face is attached.
(0097309)
ifv (developer)
2020-12-04 12:22
edited on: 2020-12-04 12:23

Bounding box is correct and built according to poles of surface.
See attached picture aabb.jpg

(0097311)
emv (developer)
2020-12-04 12:34

Have you checked it on the attached face? Could you please attach the Bounding box itself?
(0097319)
ifv (developer)
2020-12-04 14:39

Dear emv, I was wrong, it is bug in BndBox algorithm, I will write my considerations soon.
(0097332)
ifv (developer)
2020-12-04 18:31

Bug is caused by wrong defining restricted subset of poles, which is used for bounding box calculation if surface is periodic.
There are some ways to fix this bug:
1. Two "fast" ways, which required only few lines of code:
1.1 Using default algorithm, based on point grid NbUsamples*NbVsamples for periodic surfaces; such approach can cause bad performance for surfaces with big degree and number of knots, because NbSamples depends on these variables.
1.2 It is possible to make not periodic surface from periodic one and use it for calculation bounding box.
2. Right way - correction of bug in algorithm of selection of poles for periodic surfaces - demands some time for the study theory of splines.
(0097403)
ifv (developer)
2020-12-07 09:12
edited on: 2020-12-07 09:27

I think, that problem for periodical surfaces is caused by restricting calculated maximal pole number in method ComputePolesIndexes(...):

theOutMaxIdx = Min(theOutMaxIdx - 2 + theDegree + 1 - theShiftCoeff, theMaxIdx);
theMaxIdx is maximal possible pole number.

It is correct for not periodic case, but for periodic one it is necessary to make periodic continuation, for example, if theOutMaxIdx = theMaxIdx + 1, it means that 1-st pole must be added in bounding box too.

By the way, code must be refined, because everywhere we meet using
S.BSpline()->, for example:
 anUFlatKnotsCount = S.BSpline()->NbUPoles() + S.BSpline()->UDegree() + 1;

But calling S.Bspline() uses transforming of object for BRepAdaptor_Surface:

Handle(Geom_BSplineSurface) BRepAdaptor_Surface::BSpline() const
{
  return Handle(Geom_BSplineSurface)::DownCast
    (mySurf.BSpline()->Transformed(myTrsf));
}
It necessary to replace S.BSpline()->Degree(),..., by S.Degree()...

(0097445)
git (administrator)
2020-12-09 17:28

Branch CR31974 has been created by ifv.

SHA-1: e258998aea320bec0a883c1bd35bb2eb50c33ba7


Detailed log of new commits:

Author: ifv
Date: Wed Dec 9 17:28:37 2020 +0300

    0031974: Strange behavior of boolean operations on this BREP
(0097473)
git (administrator)
2020-12-10 17:14

Branch CR31974 has been updated forcibly by ifv.

SHA-1: a0364abdb4947ff955c0fd09fc8e575fc7877795
(0097486)
git (administrator)
2020-12-11 14:54

Branch CR31974 has been updated forcibly by ifv.

SHA-1: 3f841c6ccc34f266130744120dd092b2a868ad38
(0097553)
git (administrator)
2020-12-12 21:17

Branch CR31974 has been updated forcibly by ifv.

SHA-1: 906b3356d15b66c6a246e25a96444992764aa61e
(0098190)
geuzaine (reporter)
2021-01-19 10:18

The fix for 0031995 seems to solve the issue, so I think you can close this one as well.

For future reference, here's the original issue in Gmsh: https://gitlab.onelab.info/gmsh/gmsh/-/issues/1086 [^]

Many thanks!
(0098193)
ifv (developer)
2021-01-19 11:15

Dear emv, bug is not reproduced now because of fix for 0031995.
I suggest to close this issue.
(0098194)
emv (developer)
2021-01-19 11:44

Test case has to be added before closing the issue. If you can add the test case, please do it, if not, I'll take care of it.
(0098196)
ifv (developer)
2021-01-19 11:49

Dear emv, add the test by yourself please.
(0098470)
git (administrator)
2021-01-28 12:35

Branch CR31974_1 has been created by emv.

SHA-1: 454b4f330cae86cd1890d0c03733ea1d619ded28


Detailed log of new commits:

Author: emv
Date: Thu Jan 28 12:34:19 2021 +0300

    0031974: Modeling Algorithms - Strange behavior of boolean operations on this BREP
    
    Problem is fixed by 0031995. Integrating test case only.
(0098472)
emv (developer)
2021-01-28 13:07

Dear Sergey, please review git branch CR31974_1

Test results:
http://occt-tests/CR31974-master-emv-OCCT/Debian80-64/bugs/modalg_7/bug31974.html [^]
http://occt-tests/CR31974-master-emv-OCCT/Windows-64-VC14/bugs/modalg_7/bug31974.html [^]
(0098480)
emv (developer)
2021-01-28 14:40

Test case integration
(0098805)
szy (manager)
2021-02-10 09:55

Review it, please.
(0098806)
msv (developer)
2021-02-10 10:27

Please raise CR31974_1 into occt.
(0098861)
bugmaster (administrator)
2021-02-13 11:10

Combination -
OCCT branch : IR-2021-02-12
master SHA - fb68dbdbd6810ee27f9398c749c5740b7bea7818
a87b7ddc8cb44606b91e3f37113847c3f5f50fdc
Products branch : IR-2021-02-12 SHA - 94205f40e685a70c77e547147d90c09e0a21c461
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: 17805.430000000237 / 17802.420000000013 [+0.02%]
Products
Total CPU difference: 11513.250000000124 / 11523.070000000105 [-0.09%]
Windows-64-VC14:
OCCT
Total CPU difference: 19375.296875 / 19372.265625 [+0.02%]
Products
Total CPU difference: 12857.265625 / 12882.921875 [-0.20%]


Image differences :
No differences that require special attention

Memory differences :
No differences that require special attention
(0099048)
git (administrator)
2021-02-21 11:44

Branch CR31974_1 has been deleted by inv.

SHA-1: 454b4f330cae86cd1890d0c03733ea1d619ded28
(0099054)
git (administrator)
2021-02-21 11:44

Branch CR31974 has been deleted by inv.

SHA-1: 906b3356d15b66c6a246e25a96444992764aa61e

- Related Changesets
occt: master 8d55cb22
Timestamp: 2021-01-28 09:34:19
Author: emv
Committer: bugmaster
Details ] Diff ]
0031974: Modeling Algorithms - Strange behavior of boolean operations on this BREP

Problem is fixed by 0031995. Integrating test case only.
add - tests/bugs/modalg_7/bug31974 Diff ] File ]

- Issue History
Date Modified Username Field Change
2020-12-03 12:21 geuzaine New Issue
2020-12-03 12:21 geuzaine Assigned To => Andrey GOLODAEV
2020-12-03 12:21 geuzaine File Added: test.brep
2020-12-03 12:26 kgv Assigned To Andrey GOLODAEV => msv
2020-12-03 12:26 kgv Target Version => 7.6.0*
2020-12-03 13:07 abv Assigned To msv => emv
2020-12-03 13:07 abv Note Added: 0097270
2020-12-03 16:08 emv Status new => assigned
2020-12-03 17:06 emv Note Added: 0097275
2020-12-03 17:06 emv File Added: AABB_inv.png
2020-12-04 08:29 emv File Added: fx.brep
2020-12-04 08:30 emv Note Added: 0097294
2020-12-04 08:31 emv Assigned To emv => ifv
2020-12-04 12:19 ifv File Added: aabb.jpg
2020-12-04 12:22 ifv Note Added: 0097309
2020-12-04 12:22 ifv Assigned To ifv => emv
2020-12-04 12:22 ifv Status assigned => feedback
2020-12-04 12:23 ifv Note Edited: 0097309 View Revisions
2020-12-04 12:34 emv Note Added: 0097311
2020-12-04 14:39 ifv Note Added: 0097319
2020-12-04 18:31 ifv Note Added: 0097332
2020-12-07 09:12 ifv Note Added: 0097403
2020-12-07 09:14 ifv Note Edited: 0097403 View Revisions
2020-12-07 09:27 ifv Note Edited: 0097403 View Revisions
2020-12-07 09:50 msv Assigned To emv => ifv
2020-12-07 09:50 msv Status feedback => assigned
2020-12-09 17:28 git Note Added: 0097445
2020-12-10 17:14 git Note Added: 0097473
2020-12-10 17:16 kgv Summary Strange behavior of boolean operations on this BREP => Modeling Algorithms - Strange behavior of boolean operations on this BREP
2020-12-11 14:54 git Note Added: 0097486
2020-12-12 21:17 git Note Added: 0097553
2020-12-14 09:50 ifv File Added: bug31974.brep
2020-12-14 09:50 ifv File Deleted: aabb.jpg
2020-12-14 12:25 ifv Relationship added parent of 0031995
2020-12-14 12:35 ifv File Deleted: bug31974.brep
2021-01-19 10:18 geuzaine Note Added: 0098190
2021-01-19 11:15 ifv Note Added: 0098193
2021-01-19 11:15 ifv Assigned To ifv => emv
2021-01-19 11:15 ifv Status assigned => resolved
2021-01-19 11:15 ifv Steps to Reproduce Updated View Revisions
2021-01-19 11:44 emv Note Added: 0098194
2021-01-19 11:49 ifv Note Added: 0098196
2021-01-28 12:35 git Note Added: 0098470
2021-01-28 13:06 emv Status resolved => assigned
2021-01-28 13:07 emv Note Added: 0098472
2021-01-28 13:07 emv Assigned To emv => szy
2021-01-28 13:07 emv Status assigned => resolved
2021-01-28 14:40 emv Note Added: 0098480
2021-02-10 09:55 szy Note Added: 0098805
2021-02-10 09:55 szy Assigned To szy => msv
2021-02-10 09:55 szy Status resolved => assigned
2021-02-10 10:13 kgv Status assigned => resolved
2021-02-10 10:27 msv Note Added: 0098806
2021-02-10 10:27 msv Assigned To msv => bugmaster
2021-02-10 10:27 msv Status resolved => reviewed
2021-02-13 11:10 bugmaster Note Added: 0098861
2021-02-13 11:10 bugmaster Status reviewed => tested
2021-02-13 11:16 bugmaster Test case number => bugs/modalg_7/bug31974
2021-02-13 11:29 bugmaster Changeset attached => occt master 8d55cb22
2021-02-13 11:29 bugmaster Status tested => verified
2021-02-13 11:29 bugmaster Resolution open => fixed
2021-02-21 11:44 git Note Added: 0099048
2021-02-21 11:44 git Note Added: 0099054


Copyright © 2000 - 2021 MantisBT Team
Powered by Mantis Bugtracker