Archived issue #0033009
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 reproduce
For reproducing this bug a DRAW command OCC33009 (or "test bugs moddata_3 bug33009)" can be used.
Public activity
9 archived notes
Participants are labeled by their role within this record.
The Line is the same in 7.5.0 and 7.6.0
Attachment 2 (PNG) (44,920 bytes)
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)
for (Standard_Integer iP = theL.Lower(); iP <= theL.Upper(); ++iP)
Attachment 1 (PNG) (34,077 bytes)
Branch [archived branch] has been created by Participant.
[revision removed]
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.
[revision removed]
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.
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/
Results are in CR33009-master-akondrat in Jenkins.
http://jenkins-test-occt/view/CR33009-master-akondrat/view/COMPARE/
I did not find the test case.
Branch [archived branch] has been updated forcibly by Participant.
[revision removed]
[revision removed]
Branches for integration:
OCCT: CR33009
Products: NOT
OCCT: CR33009
Products: NOT
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: 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
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: 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
Branch [archived branch] has been deleted by Participant.
[revision removed]
[revision removed]