mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-04-16 10:08:36 +03:00
0029667: Visualization, TKV3d - User-defined texture coordinates corrupted by StdPrs_ShadedShape
Add protection in fillTriangles() against void UV range of a face.
This commit is contained in:
parent
a38b44f172
commit
d051064495
@ -218,8 +218,10 @@ namespace
|
|||||||
|
|
||||||
if (theHasTexels && aUVNodes.Upper() == aNodes.Upper())
|
if (theHasTexels && aUVNodes.Upper() == aNodes.Upper())
|
||||||
{
|
{
|
||||||
const gp_Pnt2d aTexel = gp_Pnt2d ((-theUVOrigin.X() + (theUVRepeat.X() * (aUVNodes (aNodeIter).X() - aUmin)) / dUmax) / theUVScale.X(),
|
const gp_Pnt2d aTexel = (dUmax == 0.0 || dVmax == 0.0)
|
||||||
(-theUVOrigin.Y() + (theUVRepeat.Y() * (aUVNodes (aNodeIter).Y() - aVmin)) / dVmax) / theUVScale.Y());
|
? aUVNodes (aNodeIter)
|
||||||
|
: gp_Pnt2d ((-theUVOrigin.X() + (theUVRepeat.X() * (aUVNodes(aNodeIter).X() - aUmin)) / dUmax) / theUVScale.X(),
|
||||||
|
(-theUVOrigin.Y() + (theUVRepeat.Y() * (aUVNodes(aNodeIter).Y() - aVmin)) / dVmax) / theUVScale.Y());
|
||||||
anArray->AddVertex (aPoint, aNorm, aTexel);
|
anArray->AddVertex (aPoint, aNorm, aTexel);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
Loading…
x
Reference in New Issue
Block a user