MantisBT
Mantis Bug Tracker Workflow

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0031974Community[OCCT] OCCT:Modeling Algorithmspublic2020-12-03 12:212020-12-14 12:35
Reportergeuzaine 
Assigned Toifv 
PrioritynormalSeverityminor 
StatusassignedResolutionopen 
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
TagsNo tags attached.
Test case number
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

- 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


Copyright © 2000 - 2021 MantisBT Team
Powered by Mantis Bugtracker