occt: master e98e3990

Author Committer Branch Timestamp Parent
nbv bugmaster master 2014-10-30 11:26:16 master 05e2200b
Changeset 0025410: Tool for extended check of validity of the curve on the surface

Modifications:
1. class BOPTools_AlgoTools
1.1. method
 Standard_Boolean BOPTools_AlgoTools::ComputeTolerance
  (const Handle(Geom_Curve)& theCurve3D,
   const Handle(Geom2d_Curve)& theCurve2D,
   const Handle(Geom_Surface)& theSurf,
   const Standard_Real theFirst,
   const Standard_Real theLast,
   Standard_Real& theMaxDist,
   Standard_Real& theMaxPar)
  It computes the max distance between points taken from 3D and 2D curves by the same parameter

1.2. method
 Standard_Boolean BOPTools_AlgoTools::ComputeTolerance
  (const TopoDS_Face& theFace,
   const TopoDS_Edge& theEdge,
   Standard_Real& theMaxDist,
   Standard_Real& theParameter)
  Computes the valid value of the tolerance for the edge using the function above.

2. Added possibility to check shape on the validity of the curves on the surfaces.
2.1. New status BOPAlgo_InvalidCurveOnSurface has been added to the enumeration BOPAlgo_CheckStatus
2.2. class BOPAlgo_ArgumentAnalyzer
 method
   void BOPAlgo_ArgumentAnalyzer::TestCurveOnSurface()
 It checks each edge/face pair in the shape using the method ComputeTolerance from BOPTools_AlgoTools and stores invalid pairs to myResults.
 Invalid pairs are those which contain the edge with tolerance value less then the value computed by the ComputeTolerance method.

2.3. class BOPAlgo_CheckResult
 Added new fields:
    myMaxDist1 : Real from Standard;
    myMaxDist2 : Real from Standard;
    myMaxPar1 : Real from Standard;
    myMaxPar2 : Real from Standard;
 and corresponding setters and getters.
 These fields are used to store the results of the TestCurveOnSurface() check.

3. Added new option to the bopargcheck command and two new commands.
class BOPTest_CheckCommands
3.1. command bopargcheck
 As it is using the BOPAlgo_ArgumentAnalyzer class to check the shapes
 it checks also the validity of the curves on the surfaces.
 The output for the invalid shapes is following:

Draw[]> bopargcheck b2 /ic #f
Made faulty shape: s1COnS_1 (MaxDist = 0.0013334343378738308, MaxPar = 0.02884285498274167)
Made faulty shape: s1COnS_2 (MaxDist = 0.0013334340648766174, MaxPar = 0.02884285497934707)
Made faulty shape: s1COnS_3 (MaxDist = 0.0013335086668628978, MaxPar = 1.4133051942712607)
Made faulty shape: s1COnS_4 (MaxDist = 0.0013335086525838983, MaxPar = 1.4133051942713901)
Faulties for FIRST shape found : 4
---------------------------------
Shapes are not suppotrted by BOP: NO
Self-Intersections : NO
Check for SI has been aborted : NO
Too small edges : NO
Bad faces : NO
Too close vertices : NO
Too close edges : NO
Shapes with Continuity C0 : NO
Invalid Curve on Surface : YES Cases(4) Total shapes(8)

Faulties for SECOND shape found : 0

 The compounds s1COnS_* contain pair of edge and face.
 MaxDist is maximal distance between points taken from 3D curve of the edge and 2D curve of that edge on the face.
 MaxPar is a parameter in which the MaxDist is reached.

 To disable this check it is necessary to use option /S (bopargcheck shape /S).

3.2. command xdistef
 Usage of the command:
   xdistef edge face
 It computes distance between points taken from 3D curve of the edge and 2D curve of that edge on the face.
 Example:
Draw[]> explode s1COnS_1
s1COnS_1_1 s1COnS_1_2
Draw[]> whatis s1COnS_1_1
s1COnS_1_1 is a shape EDGE FORWARD Modified Orientable
Draw[]> whatis s1COnS_1_2
s1COnS_1_2 is a shape FACE FORWARD Modified Orientable
Draw[]> xdistef s1COnS_1_1 s1COnS_1_2
Max Distance = 0.0013334343378738308; Parameter on curve = 0.02884285498274167

3.3. command checkcurveonsurf
 Usage of the command:
  checkcurveonsurf shape.
 It checks each edge/face pair in the shape using the method ComputeTolerance from BOPTools_AlgoTools.
Example:
Draw[]> checkcurveonsurf b2
Invalid curves on surface:
edge e_0 on face f_0 (max dist: 0.0013334343378738, parameter on curve: 0.0288428549827417)
edge e_1 on face f_0 (max dist: 0.0013334340648766, parameter on curve: 0.0288428549793471)
edge e_2 on face f_1 (max dist: 0.0013335086668629, parameter on curve: 1.4133051942712607)
edge e_3 on face f_1 (max dist: 0.0013335086525839, parameter on curve: 1.4133051942713901)

Sugestions to fix the shape:
explode b2 e;
settolerance b2_6 0.0013335086668629;
settolerance b2_7 0.0013334343378738;
settolerance b2_8 0.0013334340648766;
settolerance b2_10 0.0013335086525839;

The command gives suggestions to fix the shape by increasing tolerance values of the invalid edges.
In some cases the tolerance values suggested by the tool can be very large.
Such values should be used very carefully, because setting large tolerance values to the sub-shapes
of the shape can make it non valid (self-interfered) or lead to unexpected result when using
such shapes in some operations (boolean for example).

Test case for issue CR25410
mod - src/BOPAlgo/BOPAlgo.cdl Diff File
mod - src/BOPAlgo/BOPAlgo_ArgumentAnalyzer.cdl Diff File
mod - src/BOPAlgo/BOPAlgo_ArgumentAnalyzer.cxx Diff File
mod - src/BOPAlgo/BOPAlgo_ArgumentAnalyzer.lxx Diff File
mod - src/BOPAlgo/BOPAlgo_CheckResult.cdl Diff File
mod - src/BOPAlgo/BOPAlgo_CheckResult.cxx Diff File
mod - src/BOPTest/BOPTest_CheckCommands.cxx Diff File
mod - src/BOPTools/BOPTools_AlgoTools.cdl Diff File
mod - src/BOPTools/BOPTools_AlgoTools_1.cxx Diff File
add - tests/bugs/modalg_5/bug25410 Diff File