View Issue Details

IDProjectCategoryView StatusLast Update
0032926CommunityOCCT:Codingpublic2023-03-19 22:24
Reporterkaqima Assigned Tovpozdyayev 
PrioritynormalSeverityminor 
Status closedResolutionfixed 
PlatformWindowsOSVC++ 2022 
Product Version7.6.0 
Target Version7.7.0Fixed in Version7.6.3 
Summary0032926: Coding, StdPrs_ToolTriangulatedShape::Normal() - range of "for" not correspond to the NCollection index which run in "for"
Descriptionvoid StdPrs_ToolTriangulatedShape::Normal (const TopoDS_Face& theFace,
                                           Poly_Connect& thePolyConnect,
                                           TColgp_Array1OfDir& theNormals)
{
  const Handle(Poly_Triangulation)& aPolyTri = thePolyConnect.Triangulation();
  if (!aPolyTri->HasNormals())
  {
    ComputeNormals (theFace, aPolyTri, thePolyConnect);
  }

  gp_Vec3f aNormal;
** for (Standard_Integer aNodeIter = 1; aNodeIter <= aPolyTri->NbNodes(); ++aNodeIter)
  {
** aPolyTri->Normal (aNodeIter, aNormal);
    theNormals.ChangeValue (aNodeIter).SetCoord (aNormal.x(), aNormal.y(), aNormal.z());
  }

  if (theFace.Orientation() == TopAbs_REVERSED)
  {
** for (Standard_Integer aNodeIter = 1; aNodeIter <= aPolyTri->NbNodes(); ++aNodeIter)
    {
** theNormals.ChangeValue (aNodeIter).Reverse();
    }
  }
}

code crash at line start with *
thr "for" take range between (1,aPolyTri->NbNodes())
but inside "for", theNormals,ChangeValue take range between (0,aPolyTri->NbNodes()-1)
Steps To ReproduceTopoDs_Shape currentShape;
/*
do somethine to initialize shape to a solid shell
*/
TopoDS_Face myFace = TopoDS::Face(currentShape);
TopLoc_Location aLocation;
Handle(Poly_Triangulation) myT = BRep_Tool::Triangulation(myFace, aLocation);

if (!myT.IsNull()) {
    Poly_Connect pc(myT);
    const Poly_ArrayOfNodes& Nodes= myT->InternalNodes();
        TColgp_Array1OfDir myNormal(Nodes.Lower(), Nodes.Upper());
    SST.Normal(myFace, pc, myNormal);
}
TagsNo tags attached.
Test case numberN/A

Activities

git

2022-04-09 15:04

administrator   ~0107798

Branch CR32926 has been created by kgv.

SHA-1: 67f354134780983821c119291e483073094c9bb2


Detailed log of new commits:

Author: kgv
Date: Sat Apr 9 15:04:23 2022 +0300

    0032926: Coding, StdPrs_ToolTriangulatedShape::Normal() - range of "for" not correspond to the NCollection index which run in "for"
    
    Obsolete method has been removed.

kgv

2022-04-09 20:45

developer   ~0107800

Patch removing this obsolete method is ready for review
- OCCT: branch CR32926;
- OCC Products: branch CR32926.

http://jenkins-test-occt/view/CR32926-master-KGV/

msv

2022-04-09 23:12

developer   ~0107802

It would be worth to provide information about it in upgrade guide.

git

2022-04-10 08:40

administrator   ~0107803

Branch CR32926 has been updated forcibly by kgv.

SHA-1: e74456106b9fb025761e0123e91d4b0a2345b6fb

kgv

2022-04-10 08:40

developer   ~0107804

@msv, added section to Upgrade Guide.

msv

2022-04-11 10:35

developer   ~0107831

For integration:
occt - CR32926
products - CR32926

git

2022-04-14 22:41

administrator   ~0107974

Branch CR32926 has been updated forcibly by kgv.

SHA-1: 85e69525ca78efd978699e32f4fd01ec883aea2c

git

2022-04-14 22:42

administrator   ~0107976

Branch CR32926 has been updated forcibly by kgv.

SHA-1: e74456106b9fb025761e0123e91d4b0a2345b6fb

smoskvin

2022-04-16 11:35

administrator   ~0107999

Combination -
OCCT branch : IR-2022-04-15
master SHA - 879768fbf2e2c09089d7cd64a8f93b3c9c47d09c
49e51745631c52b6c452c65adae4d6dfa21a1b1e
Products branch : IR-2022-04-15 SHA - db9f5fc1c0877a16922bb1bcbd006c614256ba97
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: 18524.440000000686 / 18453.560000000383 [+0.38%]
Products
Total CPU difference: 11765.190000000111 / 11767.510000000153 [-0.02%]
Windows-64-VC14:
OCCT
Total CPU difference: 20542.0625 / 20540.40625 [+0.01%]
Products
Total CPU difference: 13266.890625 / 13255.140625 [+0.09%]


Image differences :
No differences that require special attention

Memory differences :
No differences that require special attention

git

2022-04-16 15:35

administrator   ~0108006

Branch CR32926 has been deleted by mnt.

SHA-1: e74456106b9fb025761e0123e91d4b0a2345b6fb

Related Changesets

occt: master 08d9c0ae

2022-04-09 15:04:23

kgv


Committer: smoskvin Details Diff
0032926: Coding, StdPrs_ToolTriangulatedShape::Normal() - range of "for" not correspond to the NCollection index which run in "for"

Obsolete method has been removed.
Affected Issues
0032926
mod - dox/upgrade/upgrade.md Diff File
mod - src/StdPrs/StdPrs_ToolTriangulatedShape.cxx Diff File
mod - src/StdPrs/StdPrs_ToolTriangulatedShape.hxx Diff File

occt-products: master 06f3e1fc

2022-04-09 19:25:03

kgv


Committer: smoskvin Details Diff
0032926: Coding, StdPrs_ToolTriangulatedShape::Normal() - range of "for" not correspond to the NCollection index which run in "for"

Use BRepLib_ToolTriangulatedShape::ComputeNormals() instead of obsolete StdPrs_ToolTriangulatedShape::Normal().
Affected Issues
0032926
mod - samples/qt/SSP/src/SCATexturedShape.cxx Diff File

Issue History

Date Modified Username Field Change
2022-04-09 04:29 kaqima New Issue
2022-04-09 04:29 kaqima Assigned To => kgv
2022-04-09 04:31 kaqima Assigned To kgv => kaqima
2022-04-09 04:32 kaqima Assigned To kaqima =>
2022-04-09 15:00 kgv Summary range of "for" not correspond to the NCollection index which run in "for" => Coding, StdPrs_ToolTriangulatedShape::Normal() - range of "for" not correspond to the NCollection index which run in "for"
2022-04-09 15:04 git Note Added: 0107798
2022-04-09 20:45 kgv Assigned To => msv
2022-04-09 20:45 kgv Status new => resolved
2022-04-09 20:45 kgv Product Version 7.6.1 => 7.6.0
2022-04-09 20:45 kgv Target Version => 7.7.0
2022-04-09 20:45 kgv Test case number => N/A
2022-04-09 20:45 kgv Note Added: 0107800
2022-04-09 20:46 kgv Severity crash => minor
2022-04-09 23:12 msv Assigned To msv => kgv
2022-04-09 23:12 msv Status resolved => assigned
2022-04-09 23:12 msv Note Added: 0107802
2022-04-10 08:40 git Note Added: 0107803
2022-04-10 08:40 kgv Assigned To kgv => msv
2022-04-10 08:40 kgv Status assigned => resolved
2022-04-10 08:40 kgv Note Added: 0107804
2022-04-11 10:35 msv Assigned To msv => bugmaster
2022-04-11 10:35 msv Status resolved => reviewed
2022-04-11 10:35 msv Note Added: 0107831
2022-04-14 22:41 git Note Added: 0107974
2022-04-14 22:42 git Note Added: 0107976
2022-04-16 11:35 smoskvin Status reviewed => tested
2022-04-16 11:35 smoskvin Note Added: 0107999
2022-04-16 15:25 smoskvin Changeset attached => occt master 08d9c0ae
2022-04-16 15:25 kgv Assigned To bugmaster => kgv
2022-04-16 15:25 kgv Status tested => verified
2022-04-16 15:25 kgv Resolution open => fixed
2022-04-16 15:25 smoskvin Changeset attached => occt-products master 06f3e1fc
2022-04-16 15:35 git Note Added: 0108006
2022-10-19 15:56 smoskvin Assigned To kgv => vpozdyayev
2023-03-19 22:24 vglukhik Status verified => closed
2023-03-19 22:24 vglukhik Fixed in Version => 7.6.3