View Issue Details

IDProjectCategoryView StatusLast Update
0033009CommunityOCCT:Foundation Classespublic2023-03-19 19:21
Reportermukadi Assigned Toakondrat 
PrioritynormalSeverityminor 
Status closedResolutionfixed 
PlatformWindowsOSVC++ 2019 
Product Version7.4.0 
Target Version7.7.0Fixed in Version7.6.3 
Summary0033009: Foundation Classes - Bnd_OBB::ReBuild() expects point array starting from 0
Description
Issue in the code << Bnd_OBB.cxx >>

//=======================================================================
// Function : Constructor
// purpose : 
//=======================================================================
OBBTool::
    OBBTool(const TColgp_Array1OfPnt& theL,
            const TColStd_Array1OfReal *theLT,
            const Standard_Boolean theIsOptimal) : myPntsList(theL),
                                                   myListOfTolers(theLT),
                                                   myQualityCriterion(RealLast()),
                                                   myOptimal (theIsOptimal)
{
  if (myOptimal)
  {
    // Use linear builder for BVH construction with 30 elements in the leaf
    opencascade::handle<BVH_LinearBuilder<Standard_Real, 3> > aLBuilder =
      new BVH_LinearBuilder<Standard_Real, 3> (30);
    myPointBoxSet = new BVH_BoxSet <Standard_Real, 3, gp_XYZ> (aLBuilder);
    myPointBoxSet->SetSize(myPntsList.Length());

    // Add the points into Set
    for (Standard_Integer iP = 0; iP < theL.Length(); ++iP)
    {
      const gp_Pnt& aP = theL (iP);         <=== The code should be ::: >  aP = theL ( theL->Lower()+ iP )
      Standard_Real aTol = theLT ? theLT->Value(iP) : Precision::Confusion();
      BVH_Box <Standard_Real, 3> aBox (BVH_Vec3d (aP.X() - aTol, aP.Y() - aTol, aP.Z() - aTol),
                                       BVH_Vec3d (aP.X() + aTol, aP.Y() + aTol, aP.Z() + aTol));
      myPointBoxSet->Add (aP.XYZ(), aBox);
    }
Steps To ReproduceFor reproducing this bug a DRAW command OCC33009 (or "test bugs moddata_3 bug33009)" can be used.
TagsNo tags attached.
Test case numbertests/bugs/moddata_3/bug33009

Attached Files

  • image.png (44,920 bytes)
  • Bnd_OBB.cxx_Line_400_429.PNG (34,077 bytes)

Activities

kgv

2022-06-09 00:35

developer   ~0108921

Last edited: 2022-06-09 00:42

mukadi

2022-06-10 04:15

reporter   ~0108951

The Line is the same in 7.5.0 and 7.6.0
image.png (44,920 bytes)

mukadi

2022-06-10 04:21

reporter   ~0108952

Line 422 of the the file bnd_OBB.cxx is a bug that shout instead be something like :

   for (Standard_Integer iP = theL.Lower(); iP <= theL.Upper(); ++iP)
Bnd_OBB.cxx_Line_400_429.PNG (34,077 bytes)

git

2022-06-10 14:55

administrator   ~0108957

Branch CR33009 has been created by akondrat.

SHA-1: 84932d8577ee9fcafb0fc29dbb75c8e113c49c0e


Detailed log of new commits:

Author: Alexey Kondratyev
Date: Fri Jun 10 14:33:15 2022 +0300

    0033009: Foundation Classes - Bnd_OBB::ReBuild() expects point array starting from 0
    
    Add test. Update OBBTool constructor for any bounds of array of points.

akondrat

2022-06-14 08:47

developer   ~0108981

A solution of this bug had placed on commit CR33009.

Results are in CR33009-master-akondrat in Jenkins.
http://jenkins-test-occt/view/CR33009-master-akondrat/view/COMPARE/

azv

2022-06-14 09:26

administrator   ~0108983

I did not find the test case.

git

2022-06-14 09:55

administrator   ~0108985

Branch CR33009 has been updated forcibly by akondrat.

SHA-1: 308e8bc12852095341b69f6baa0c8fa8c8f01126

azv

2022-06-14 14:52

administrator   ~0109003

Branches for integration:
OCCT: CR33009
Products: NOT

afokin

2022-06-18 12:13

administrator   ~0109079

Combination -
OCCT branch : IR-2022-06-17
master SHA - 94748ad20e40864e60c1035e254ee5afffdc0d50
e0ceb716c70188b98130b1550914140d0502a6f9
Products branch : IR-2022-06-17 SHA - ba8a8a69d4213a88c9195eab6343815f702b57bb
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: 18769.010000000537 / 18860.170000000642 [-0.48%]
Products
Total CPU difference: 11750.300000000107 / 11722.3800000001 [+0.24%]
Windows-64-VC14:
OCCT
Total CPU difference: 20650.375 / 20670.390625 [-0.10%]
Products
Total CPU difference: 13263.109375 / 13253.046875 [+0.08%]


Image differences :
No differences that require special attention

Memory differences :
No differences that require special attention

git

2022-06-18 16:04

administrator   ~0109087

Branch CR33009 has been deleted by mnt.

SHA-1: 308e8bc12852095341b69f6baa0c8fa8c8f01126

Related Changesets

occt: master fb30026c

2022-06-10 14:33:15

akondrat


Committer: afokin Details Diff
0033009: Foundation Classes - Bnd_OBB::ReBuild() expects point array starting from 0

Add test. Update OBBTool constructor for any bounds of array of points.
Affected Issues
0033009
mod - src/Bnd/Bnd_OBB.cxx Diff File
mod - src/QABugs/QABugs_20.cxx Diff File
add - tests/bugs/moddata_3/bug33009 Diff File

Issue History

Date Modified Username Field Change
2022-06-08 22:31 mukadi New Issue
2022-06-08 22:31 mukadi Assigned To => abv
2022-06-09 00:34 kgv Summary Code would crash when Lower bound of << TColgp_Array1OfPnt >> is not "0" Issue in the code Bnd_OBB.cxx => Foundation Classes - Bnd_OBB::ReBuild() expects point array starting from 0
2022-06-09 00:35 kgv Note Added: 0108921
2022-06-09 00:36 kgv Assigned To abv => mukadi
2022-06-09 00:36 kgv Status new => feedback
2022-06-09 00:42 kgv Assigned To mukadi => azv
2022-06-09 00:42 kgv Status feedback => assigned
2022-06-09 00:42 kgv Note Edited: 0108921
2022-06-09 00:42 kgv Description Updated
2022-06-09 00:42 kgv Severity crash => minor
2022-06-09 09:18 kgv Product Version 7.5.0 => 7.4.0
2022-06-10 04:15 mukadi Note Added: 0108951
2022-06-10 04:15 mukadi File Added: image.png
2022-06-10 04:21 mukadi Note Added: 0108952
2022-06-10 04:21 mukadi File Added: Bnd_OBB.cxx_Line_400_429.PNG
2022-06-10 08:34 azv Assigned To azv => akondrat
2022-06-10 14:55 git Note Added: 0108957
2022-06-14 08:47 akondrat Assigned To akondrat => azv
2022-06-14 08:47 akondrat Status assigned => resolved
2022-06-14 08:47 akondrat Steps to Reproduce Updated
2022-06-14 08:47 akondrat Note Added: 0108981
2022-06-14 09:26 azv Assigned To azv => akondrat
2022-06-14 09:26 azv Status resolved => assigned
2022-06-14 09:26 azv Note Added: 0108983
2022-06-14 09:55 git Note Added: 0108985
2022-06-14 14:47 akondrat Assigned To akondrat => azv
2022-06-14 14:47 akondrat Status assigned => resolved
2022-06-14 14:47 akondrat Steps to Reproduce Updated
2022-06-14 14:52 azv Assigned To azv => bugmaster
2022-06-14 14:52 azv Status resolved => reviewed
2022-06-14 14:52 azv Note Added: 0109003
2022-06-18 12:12 afokin Test case number => tests/bugs/moddata_3/bug33009
2022-06-18 12:13 afokin Status reviewed => tested
2022-06-18 12:13 afokin Note Added: 0109079
2022-06-18 16:00 afokin Changeset attached => occt master fb30026c
2022-06-18 16:00 akondrat Assigned To bugmaster => akondrat
2022-06-18 16:00 akondrat Status tested => verified
2022-06-18 16:00 akondrat Resolution open => fixed
2022-06-18 16:04 git Note Added: 0109087
2022-06-28 06:37 azv Target Version => 7.7.0
2023-03-19 19:21 vglukhik Status verified => closed
2023-03-19 19:21 vglukhik Fixed in Version => 7.6.3