1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-09 13:22:24 +03:00

0030679: Attached model hangs most of OCCT common functionality

Evaluator of offset surface has been protected against evaluation at infinite parameters. Now it throws exception when evaluating such data.

The methods IsUClosed and IsVClosed of the class ShapeAnalysis_Surface have been corrected to avoid evaluation of the surface at infinite parameters (fighting with regressions "parasolid doc_3 E3" and "parasolid doc_2 A3" in products).
This commit is contained in:
msv
2019-05-13 16:19:35 +03:00
committed by bugmaster
parent 52c38ce17d
commit 4811214cc0
3 changed files with 86 additions and 32 deletions

View File

@@ -23,6 +23,7 @@
#include <GeomAdaptor_HSurface.hxx>
#include <gp_Vec.hxx>
#include <Standard_RangeError.hxx>
#include <Standard_NumericError.hxx>
IMPLEMENT_STANDARD_RTTIEXT(GeomEvaluator_OffsetSurface,GeomEvaluator_Surface)
@@ -212,6 +213,21 @@ static void derivatives(Standard_Integer theMaxOrder,
}
}
inline Standard_Boolean IsInfiniteCoord (const gp_Vec& theVec)
{
return Precision::IsInfinite (theVec.X()) ||
Precision::IsInfinite (theVec.Y()) ||
Precision::IsInfinite (theVec.Z());
}
inline void CheckInfinite (const gp_Vec& theVecU, const gp_Vec& theVecV)
{
if (IsInfiniteCoord (theVecU) || IsInfiniteCoord (theVecV))
{
throw Standard_NumericError ("GeomEvaluator_OffsetSurface: Evaluation of infinite parameters");
}
}
} // end of anonymous namespace
GeomEvaluator_OffsetSurface::GeomEvaluator_OffsetSurface(
@@ -251,6 +267,9 @@ void GeomEvaluator_OffsetSurface::D0(
{
gp_Vec aD1U, aD1V;
BaseD1 (aU, aV, theValue, aD1U, aD1V);
CheckInfinite (aD1U, aD1V);
try
{
CalculateD0(aU, aV, theValue, aD1U, aD1V);
@@ -276,6 +295,9 @@ void GeomEvaluator_OffsetSurface::D1(
{
gp_Vec aD2U, aD2V, aD2UV;
BaseD2 (aU, aV, theValue, theD1U, theD1V, aD2U, aD2V, aD2UV);
CheckInfinite (theD1U, theD1V);
try
{
CalculateD1(aU, aV, theValue, theD1U, theD1V, aD2U, aD2V, aD2UV);
@@ -303,6 +325,9 @@ void GeomEvaluator_OffsetSurface::D2(
gp_Vec aD3U, aD3V, aD3UUV, aD3UVV;
BaseD3 (aU, aV, theValue, theD1U, theD1V,
theD2U, theD2V, theD2UV, aD3U, aD3V, aD3UUV, aD3UVV);
CheckInfinite (theD1U, theD1V);
try
{
CalculateD2 (aU, aV, theValue, theD1U, theD1V,
@@ -331,6 +356,9 @@ void GeomEvaluator_OffsetSurface::D3(
{
BaseD3 (aU, aV, theValue, theD1U, theD1V,
theD2U, theD2V, theD2UV, theD3U, theD3V, theD3UUV, theD3UVV);
CheckInfinite (theD1U, theD1V);
try
{
CalculateD3 (aU, aV, theValue, theD1U, theD1V,
@@ -363,6 +391,9 @@ gp_Vec GeomEvaluator_OffsetSurface::DN(
gp_Pnt aP;
gp_Vec aD1U, aD1V;
BaseD1 (aU, aV, aP, aD1U, aD1V);
CheckInfinite (aD1U, aD1V);
try
{
return CalculateDN (aU, aV, theDerU, theDerV, aD1U, aD1V);