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

0029059: It is necessary to have a unique way of checking of the validity of the edge and its 2D curves

Add new class BRepLib_ValidateEdge to use for edge checking instead of functions:
- Validate() from BOPTools_AlgoTools.cxx
- Validate() from BRepCheck_Edge.cxx
- ShapeAnalysis_Edge::ComputeDeviation()
This commit is contained in:
asuraven
2021-04-28 12:06:39 +03:00
committed by bugmaster
parent 51d4a4f9d0
commit c9337e33a6
14 changed files with 385 additions and 429 deletions

View File

@@ -20,6 +20,7 @@
#include <Adaptor3d_CurveOnSurface.hxx>
#include <BRepBuilderAPI_MakeEdge.hxx>
#include <BRepLib.hxx>
#include <BRepLib_ValidateEdge.hxx>
#include <BRep_Tool.hxx>
#include <BRepOffset.hxx>
#include <Geom_OffsetSurface.hxx>
@@ -35,9 +36,6 @@
#include <TopoDS_Edge.hxx>
#include <TopoDS_Vertex.hxx>
static const Standard_Integer NCONTROL=22;
//=============================================================================
//function : BRepOffset_SimpleOffset
//purpose : Constructor
@@ -293,15 +291,19 @@ void BRepOffset_SimpleOffset::FillEdgeData(const TopoDS_Edge& theEdge,
const Handle(Geom2d_Curve) aC2dNew = BRep_Tool::CurveOnSurface(theEdge, aCurFace, aF, aL);
const Handle(Adaptor2d_Curve2d) aHCurve2d = new Geom2dAdaptor_Curve(aC2dNew, aF, aL);
const Handle(Adaptor3d_Surface) aHSurface = new GeomAdaptor_Surface(myFaceInfo.Find(aCurFace).myOffsetS);
Adaptor3d_CurveOnSurface aCurveOnSurf(aHCurve2d, aHSurface);
const Handle(Adaptor3d_CurveOnSurface) aCurveOnSurf = new Adaptor3d_CurveOnSurface(aHCurve2d, aHSurface);
// Extract 3d-curve (it is not null).
const GeomAdaptor_Curve aCurve3d(aNED.myOffsetC, aF, aL);
const Handle(Adaptor3d_Curve) aCurve3d = new GeomAdaptor_Curve(aNED.myOffsetC, aF, aL);
// It is necessary to compute maximal deviation (tolerance).
Standard_Real aMaxTol = 0.0;
ShapeAnalysis_Edge::ComputeDeviation(aCurve3d, aCurveOnSurf, Standard_True, aMaxTol, NCONTROL);
anEdgeTol = Max (anEdgeTol, aMaxTol);
BRepLib_ValidateEdge aValidateEdge(aCurve3d, aCurveOnSurf, Standard_True);
aValidateEdge.Process();
if (aValidateEdge.IsDone())
{
Standard_Real aMaxTol1 = aValidateEdge.GetMaxDistance();
anEdgeTol = Max (anEdgeTol, aMaxTol1);
}
}
aNED.myTol = Max(BRep_Tool::Tolerance(aNewEdge), anEdgeTol);