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

0028605: Improve the algorithm of calculation of valid intersection range of an edge

- New method BRepLib::FindValidRange() has been added. It computes the range of the edge not covered by boundary vertices.
- The algorithm of calculation of valid intersection range in the class IntTools_ShrunkRange has been corrected to use the new method.
- The method BOPTools_AlgoTools::MakeSplitEdge() has been improved to protect against errors in the case of reversed orientation of the input edge.
- Two new Draw commands have been added:
  validrange - it calls the new method BRepLib::FindValidRange().
  tolsphere  - it shows tolerances of vertices by drawing a sphere around each vertex of the shape.
- The test cases "offset shape_type_i_c YE1,YE2" became better. The scripts have been corrected to reflect the new state.
This commit is contained in:
msv
2017-03-24 16:04:05 +03:00
committed by bugmaster
parent 501d0d386a
commit c0a1a35fac
10 changed files with 441 additions and 66 deletions

View File

@@ -14,6 +14,7 @@
#include <Bnd_Box.hxx>
#include <BRepLib.hxx>
#include <BndLib_Add3dCurve.hxx>
#include <BRep_Tool.hxx>
#include <BRepAdaptor_Curve.hxx>
@@ -133,6 +134,8 @@ void IntTools_ShrunkRange::Perform()
return;
}
//
gp_Pnt aP1 = BRep_Tool::Pnt(myV1);
gp_Pnt aP2 = BRep_Tool::Pnt(myV2);
Standard_Real aTolE, aTolV1, aTolV2;
aTolE = BRep_Tool::Tolerance(myEdge);
aTolV1 = BRep_Tool::Tolerance(myV1);
@@ -150,8 +153,22 @@ void IntTools_ShrunkRange::Perform()
// the tolerances of vertices are increased on Precision::Confusion()
aTolV1 += aDTol;
aTolV2 += aDTol;
//
// compute the shrunk range - part of the edge not covered
// by the tolerance spheres of its vertices
BRepAdaptor_Curve aBAC(myEdge);
if (!BRepLib::FindValidRange(aBAC, aTolE, myT1, aP1, aTolV1,
myT2, aP2, aTolV2, myTS1, myTS2)) {
// no valid range
return;
}
if ((myTS2 - myTS1) < aPDTol) {
// micro edge
return;
}
//
// compute the length of the edge on the shrunk range
//
// parametric tolerance for the edge
// to be used in AbscissaPoint computations
Standard_Real aPTolE = aBAC.Resolution(aTolE);
@@ -161,31 +178,6 @@ void IntTools_ShrunkRange::Perform()
if (aPTolE > aPTolEMin) {
aPTolE = aPTolEMin;
}
//
// compute the shrunk range - part of the edge not covered
// by the tolerance spheres of its vertices
GCPnts_AbscissaPoint aPC1(aBAC, aTolV1, myT1, aPTolE);
// if Abscissa is unable to compute the parameter
// use the resolution of the curve
myTS1 = aPC1.IsDone() ? aPC1.Parameter() : (myT1 + aBAC.Resolution(aTolV1));
if (myT2 - myTS1 < aPDTol) {
// micro edge
return;
}
//
GCPnts_AbscissaPoint aPC2(aBAC, -aTolV2, myT2, aPTolE);
myTS2 = aPC2.IsDone() ? aPC2.Parameter() : (myT2 - aBAC.Resolution(aTolV2));
if (myTS2 - myT1 < aPDTol) {
// micro edge
return;
}
//
if ((myTS2 - myTS1) < aPDTol) {
// micro edge
return;
}
//
// compute the length of the edge on the shrunk range
Standard_Real anEdgeLength =
GCPnts_AbscissaPoint::Length(aBAC, myTS1, myTS2, aPTolE);
if (anEdgeLength < aDTol) {