0023552: Projection algorithm produces wrong results with default tolerance value.
authorpkv <pkv@opencascade.com>
Fri, 18 Jan 2013 09:39:21 +0000 (13:39 +0400)
committerpkv <pkv@opencascade.com>
Fri, 18 Jan 2013 09:39:21 +0000 (13:39 +0400)
Add TKShHealing to TKFillet/EXTERNLIB
Adding test case

src/ChFi3d/ChFi3d_Builder.cxx
src/ProjLib/ProjLib_ProjectedCurve.cxx
src/TKFillet/EXTERNLIB
tests/blend/complex/F6
tests/chamfer/data/complex/B6

index 473c9cb..5b8fe07 100755 (executable)
@@ -64,7 +64,9 @@
 
 #include <ChFi3d_Builder_0.hxx>
 #include <TopOpeBRepDS_ListOfInterference.hxx>
 
 #include <ChFi3d_Builder_0.hxx>
 #include <TopOpeBRepDS_ListOfInterference.hxx>
-
+#include <BRepLib.hxx>
+#include <ShapeFix.hxx>
+#include <Precision.hxx>
 
 #ifdef DRAW
 #include <TestTopOpeTools.hxx>
 
 #ifdef DRAW
 #include <TestTopOpeTools.hxx>
@@ -73,6 +75,8 @@
 #ifdef DEB
 #include <OSD_Chronometer.hxx>
 
 #ifdef DEB
 #include <OSD_Chronometer.hxx>
 
+
+
 // variables for performances 
 
 
 // variables for performances 
 
 
@@ -557,6 +561,27 @@ void  ChFi3d_Builder::Compute()
     cout<<"-temps ChFi3d_sameparameter "<<t_sameparam<<"s"<<endl<<endl;
   }
 #endif
     cout<<"-temps ChFi3d_sameparameter "<<t_sameparam<<"s"<<endl<<endl;
   }
 #endif
+  //
+  // Inspect the new faces to provide sameparameter 
+  // if it is necessary
+  if (IsDone())
+  {
+    Standard_Real SameParTol = Precision::Confusion();
+    Standard_Integer aNbSurfaces, iF;
+    TopTools_ListIteratorOfListOfShape aIt;
+    //
+    aNbSurfaces=myDS->NbSurfaces();
+    
+    for (iF=1; iF<=aNbSurfaces; ++iF) {
+      const TopTools_ListOfShape& aLF=myCoup->NewFaces(iF);
+      aIt.Initialize(aLF);
+      for (; aIt.More(); aIt.Next()) {
+       const TopoDS_Shape& aF=aIt.Value();
+       BRepLib::SameParameter(aF, SameParTol, Standard_True);
+       ShapeFix::SameParameter(aF, Standard_False, SameParTol);
+      }
+    }
+  }
 }
 
 //=======================================================================
 }
 
 //=======================================================================
index 5acd16d..5c94aef 100755 (executable)
@@ -558,7 +558,7 @@ static void Project(ProjLib_Projector& P, Handle(Adaptor3d_HCurve)& C)
 ProjLib_ProjectedCurve::ProjLib_ProjectedCurve()
 
 {
 ProjLib_ProjectedCurve::ProjLib_ProjectedCurve()
 
 {
-  myTolerance = Precision::PApproximation();
+  myTolerance = Precision::Confusion();
 }
 
 
 }
 
 
@@ -570,7 +570,7 @@ ProjLib_ProjectedCurve::ProjLib_ProjectedCurve()
 ProjLib_ProjectedCurve::ProjLib_ProjectedCurve
 (const Handle(Adaptor3d_HSurface)& S)
 {
 ProjLib_ProjectedCurve::ProjLib_ProjectedCurve
 (const Handle(Adaptor3d_HSurface)& S)
 {
-  myTolerance = Precision::PApproximation();
+  myTolerance = Precision::Confusion();
   Load(S);
 }
 
   Load(S);
 }
 
@@ -584,7 +584,7 @@ ProjLib_ProjectedCurve::ProjLib_ProjectedCurve
 (const Handle(Adaptor3d_HSurface)& S,
  const Handle(Adaptor3d_HCurve)& C)
 {
 (const Handle(Adaptor3d_HSurface)& S,
  const Handle(Adaptor3d_HCurve)& C)
 {
-  myTolerance = Precision::PApproximation();
+  myTolerance = Precision::Confusion();
   Load(S);
   Load(C);
 }
   Load(S);
   Load(C);
 }
@@ -600,7 +600,7 @@ ProjLib_ProjectedCurve::ProjLib_ProjectedCurve
  const Handle(Adaptor3d_HCurve)&   C,
  const Standard_Real             Tol)
 {
  const Handle(Adaptor3d_HCurve)&   C,
  const Standard_Real             Tol)
 {
-  myTolerance = Max(Tol, Precision::PApproximation());
+  myTolerance = Max(Tol, Precision::Confusion());
   Load(S);
   Load(C);
 }
   Load(S);
   Load(C);
 }
@@ -624,7 +624,7 @@ void ProjLib_ProjectedCurve::Load(const Handle(Adaptor3d_HSurface)& S)
 
 void ProjLib_ProjectedCurve::Load(const Handle(Adaptor3d_HCurve)& C)
 {
 
 void ProjLib_ProjectedCurve::Load(const Handle(Adaptor3d_HCurve)& C)
 {
-  myTolerance = Max(myTolerance,Precision::PApproximation());
+  myTolerance = Max(myTolerance, Precision::Confusion());
   myCurve = C;
   Standard_Real FirstPar = C->FirstParameter();
   Standard_Real LastPar  = C->LastParameter();
   myCurve = C;
   Standard_Real FirstPar = C->FirstParameter();
   Standard_Real LastPar  = C->LastParameter();
index f7902e7..576994d 100755 (executable)
@@ -7,3 +7,4 @@ TKG2d
 TKTopAlgo
 TKG3d
 TKBool
 TKTopAlgo
 TKG3d
 TKBool
+TKShHealing
index 8d0663c..5226fef 100644 (file)
@@ -3,7 +3,7 @@
 ## Test    : K7
 ## Comment : from cts21020
 ## ====================================
 ## Test    : K7
 ## Comment : from cts21020
 ## ====================================
-puts "TODO OCC22817 All:Faulty shapes in variables faulty_1 to faulty_14"
+puts "TODO OCC22817 All:Faulty shapes in variables faulty_1 to faulty_"
 
 restore [locate_data_file CFI_cts21020.rle] a
 explode a e
 
 restore [locate_data_file CFI_cts21020.rle] a
 explode a e
index 2a0847c..f70f1c7 100644 (file)
@@ -13,6 +13,6 @@ if { [string compare $command chamf] == 0 } {
     set os $env(os_type)
   }
   if {[string compare $group dist_angle] == 0} {
     set os $env(os_type)
   }
   if {[string compare $group dist_angle] == 0} {
-    puts "TODO OCC22909 All:Faulty shapes in variables faulty_1 to faulty_12"
+    puts "TODO OCC22909 All:Faulty shapes in variables faulty_1 to faulty_"
   }
 }
   }
 }