mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-14 13:30:48 +03:00
0032279: Draw Harness - protect incmesh from hanging on syntax error
- improved incmesh to raise exception on invalid input parameters - added possibility to operate multiple objects - added checking for too small values in BrepMesh algorithm
This commit is contained in:
@@ -17,6 +17,7 @@
|
||||
#include <BRepMesh_DiscretRoot.hxx>
|
||||
#include <IMeshTools_Parameters.hxx>
|
||||
#include <IMeshTools_Context.hxx>
|
||||
#include <Standard_NumericError.hxx>
|
||||
|
||||
//! Builds the mesh of a shape with respect of their
|
||||
//! correctly triangulated parts
|
||||
@@ -91,6 +92,10 @@ private:
|
||||
//! Initializes specific parameters
|
||||
void initParameters()
|
||||
{
|
||||
if (myParameters.Deflection < Precision::Confusion())
|
||||
{
|
||||
throw Standard_NumericError ("BRepMesh_IncrementalMesh::initParameters : invalid parameter value");
|
||||
}
|
||||
if (myParameters.DeflectionInterior < Precision::Confusion())
|
||||
{
|
||||
myParameters.DeflectionInterior = myParameters.Deflection;
|
||||
@@ -104,6 +109,10 @@ private:
|
||||
Precision::Confusion());
|
||||
}
|
||||
|
||||
if (myParameters.Angle < Precision::Angular())
|
||||
{
|
||||
throw Standard_NumericError ("BRepMesh_IncrementalMesh::initParameters : invalid parameter value");
|
||||
}
|
||||
if (myParameters.AngleInterior < Precision::Angular())
|
||||
{
|
||||
myParameters.AngleInterior = 2.0 * myParameters.Angle;
|
||||
|
Reference in New Issue
Block a user