mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-04 13:13:25 +03:00
0032448: Modeling Algorithms - Provide exact validating (as option) using GeomLib_CheckCurveOnSurface
Add '-exact' option to checkshape command to use exact method to validate edges using BRepLib_ValidateEdge class. Default mode is calculating in finite number of points.
This commit is contained in:
@@ -17,6 +17,7 @@
|
||||
#include <Adaptor3d_CurveOnSurface.hxx>
|
||||
#include <BRepCheck.hxx>
|
||||
#include <Extrema_LocateExtPC.hxx>
|
||||
#include <GeomLib_CheckCurveOnSurface.hxx>
|
||||
|
||||
//=============================================================================
|
||||
//function : BRepLib_ValidateEdge
|
||||
@@ -32,7 +33,9 @@ BRepLib_ValidateEdge::BRepLib_ValidateEdge(Handle(Adaptor3d_Curve) theReferenceC
|
||||
myToleranceForChecking(0),
|
||||
myCalculatedDistance(0),
|
||||
myExitIfToleranceExceeded(Standard_False),
|
||||
myIsDone(Standard_False)
|
||||
myIsDone(Standard_False),
|
||||
myIsExactMethod(Standard_False),
|
||||
myIsMultiThread(Standard_False)
|
||||
{ }
|
||||
|
||||
//=============================================================================
|
||||
@@ -96,6 +99,22 @@ void BRepLib_ValidateEdge::SetExitIfToleranceExceeded(Standard_Real theTolerance
|
||||
//purpose :
|
||||
//=============================================================================
|
||||
void BRepLib_ValidateEdge::Process()
|
||||
{
|
||||
if (myIsExactMethod && mySameParameter)
|
||||
{
|
||||
processExact();
|
||||
}
|
||||
else
|
||||
{
|
||||
processApprox();
|
||||
}
|
||||
}
|
||||
|
||||
//=============================================================================
|
||||
//function : processApprox
|
||||
//purpose :
|
||||
//=============================================================================
|
||||
void BRepLib_ValidateEdge::processApprox()
|
||||
{
|
||||
myIsDone = Standard_True;
|
||||
Standard_Real aSquareToleranceForChecking = myToleranceForChecking * myToleranceForChecking;
|
||||
@@ -212,3 +231,20 @@ void BRepLib_ValidateEdge::Process()
|
||||
}
|
||||
myCalculatedDistance = Sqrt(aMaxSquareDistance);
|
||||
}
|
||||
|
||||
//=============================================================================
|
||||
//function : processExact
|
||||
//purpose :
|
||||
//=============================================================================
|
||||
void BRepLib_ValidateEdge::processExact()
|
||||
{
|
||||
GeomLib_CheckCurveOnSurface aCheckCurveOnSurface(myReferenceCurve);
|
||||
aCheckCurveOnSurface.SetParallel(myIsMultiThread);
|
||||
aCheckCurveOnSurface.Perform(myOtherCurve);
|
||||
myIsDone = aCheckCurveOnSurface.IsDone();
|
||||
if (myIsDone)
|
||||
{
|
||||
myCalculatedDistance = aCheckCurveOnSurface.MaxDistance();
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user