1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-04-03 17:56:21 +03:00

0033631: Data Exchange, Step import - Crash by reading STEP file

Creating Poly_Triangulation from ComplexTriangulatedSurfaceSet was fixed.
This commit is contained in:
ichesnok 2024-03-08 13:38:18 +00:00 committed by vglukhik
parent 3888b58c27
commit d5bcd33386

View File

@ -2018,7 +2018,7 @@ Handle(Poly_Triangulation) createMesh(const Handle(StepVisual_ComplexTriangulate
const Standard_Integer aNbNormals = theTriangulatedSufaceSet->NbNormals();
// Number of pairs (Point, Normal). It is possible for one point to have multiple normals. This is
// useful when the underlying surface is not C1 continuous.
const Standard_Integer aNbPairs = aNbNormals > 1 ? theTriangulatedSufaceSet->NbPnindex() : aNodes->Length();
const Standard_Integer aNbPairs = aNbNormals > 1 ? theTriangulatedSufaceSet->Pnmax() : aNodes->Length();
const Standard_Boolean aHasNormals = aNbNormals > 0;
// Counting number of triangles in the triangle strips list.
@ -2043,7 +2043,7 @@ Handle(Poly_Triangulation) createMesh(const Handle(StepVisual_ComplexTriangulate
for (Standard_Integer j = 1; j <= aNbPairs; ++j)
{
const gp_XYZ& aPoint = aNodes->Value(aNbNormals > 1 ? theTriangulatedSufaceSet->PnindexValue(j) : j);
const gp_XYZ& aPoint = aNodes->Value((aNbNormals > 1 && theTriangulatedSufaceSet->NbPnindex() > 0) ? theTriangulatedSufaceSet->PnindexValue(j) : j);
aMesh->SetNode(j, theFact * aPoint);
}