From: vro Date: Mon, 15 Feb 2021 13:13:46 +0000 (+0300) Subject: 0025936: Modeling Data - reusable data structure for 2D tesselation (3- and 4-nodal... X-Git-Url: http://git.dev.opencascade.org/gitweb/?a=commitdiff_plain;h=refs%2Fheads%2FCR25936_5;p=occt-copy.git 0025936: Modeling Data - reusable data structure for 2D tesselation (3- and 4-nodal mesh) // Fixed a regression in bugs vis bug30630_1 (mirrored shape) --- diff --git a/src/StdPrs/StdPrs_ShadedShape.cxx b/src/StdPrs/StdPrs_ShadedShape.cxx index a434c61daa..9ff3ab6449 100644 --- a/src/StdPrs/StdPrs_ShadedShape.cxx +++ b/src/StdPrs/StdPrs_ShadedShape.cxx @@ -188,10 +188,8 @@ namespace // Determinant of transform matrix less then 0 means that mirror transform applied. Standard_Boolean isMirrored = aTrsf.VectorialPart().Determinant() < 0; - Poly_Connect aPolyConnect (aT); // Extracts vertices & normals from nodes - TColgp_Array1OfDir aNormals (1, aT->NbNodes()); - StdPrs_ToolTriangulatedShape::Normal (aFace, aPolyConnect, aNormals); + StdPrs_ToolTriangulatedShape::ComputeNormals (aFace, aT); if (theHasTexels) { @@ -200,11 +198,17 @@ namespace dVmax = (aVmax - aVmin); } + gp_Dir aNorm; const Standard_Integer aDecal = anArray->VertexNumber(); for (Standard_Integer aNodeIter = 1; aNodeIter <= aT->NbNodes(); ++aNodeIter) { aPoint = aT->Node (aNodeIter); - gp_Dir aNorm = aNormals (aNodeIter); + const Vec3f& aVec = aT->Normal (aNodeIter); + aNorm.SetCoord (aVec.x(), aVec.y(), aVec.z()); + if ((aFace.Orientation() == TopAbs_REVERSED) ^ isMirrored) + { + aNorm.Reverse(); + } if (!aLoc.IsIdentity()) { aPoint.Transform (aTrsf);