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.
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);
}