]> OCCT Git - occt-copy.git/commitdiff
Line-Plane extrema has been added in analytical case.
authornbv <nbv@opencascade.com>
Fri, 15 Jul 2016 12:56:21 +0000 (15:56 +0300)
committernbv <nbv@opencascade.com>
Mon, 18 Jul 2016 08:28:26 +0000 (11:28 +0300)
src/Extrema/Extrema_ExtCS.cxx
src/Extrema/Extrema_ExtElCS.cxx
src/Extrema/Extrema_POnSurf.cdl
src/GeometryTest/GeometryTest_APICommands.cxx
tests/bugs/moddata_3/bug26038_1
tests/bugs/moddata_3/bug26038_2

index eec8eb001413606dd8ca873b20f656bfad9bf369..1304aef323b301d201a808ebe66b4df519c820d7 100644 (file)
@@ -123,7 +123,7 @@ void Extrema_ExtCS::Perform(const Adaptor3d_Curve& C,
         break;
       case GeomAbs_Plane:
         myExtElCS.Perform(C.Line(), myS->Plane());
-        if (myExtElCS.IsParallel())   break;
+        if (myExtElCS.IsParallel() || myExtElCS.NbExt() > 0)   break;
 
       case GeomAbs_Torus:
       case GeomAbs_Cone:
index 8a322491401b4f335d8bbffdfc0df714b1e0d66d..49aa83764315e5848bf5e411ea6d4e4045c96a53 100644 (file)
@@ -56,10 +56,39 @@ void Extrema_ExtElCS::Perform(const gp_Lin& C,
     mySqDist->SetValue(1, S.SquareDistance(C));
     myIsPar = Standard_True;
   }
-  else {
+  else
+  {
     myNbExt = 0;
-  }
-  
+
+    IntAna_IntConicQuad anInter(C, S,
+                                Precision::Angular(),
+                                Precision::Confusion());
+    if(anInter.IsDone())
+    {
+      myNbExt = anInter.NbPoints();
+    }
+
+    if(myNbExt == 0)
+      return;
+
+    myPoint1 = new Extrema_HArray1OfPOnCurv(1, myNbExt);
+    mySqDist = new TColStd_HArray1OfReal(1, myNbExt);
+    myPoint2 = new Extrema_HArray1OfPOnSurf(1, myNbExt);
+
+    Standard_Real aUSurf = 0.0, aVSurf = 0.0;
+    Extrema_POnCurv aPOnC;
+    Extrema_POnSurf aPOnS;
+
+    const gp_Pnt& aPC = anInter.Point(1);
+    aPOnC.SetValues(anInter.ParamOnConic(1), aPC);
+    myPoint1->SetValue(1, aPOnC);
+
+    ElSLib::PlaneParameters(S.Position(), aPC, aUSurf, aVSurf);
+    const gp_Pnt aPS(ElSLib::PlaneValue(aUSurf, aVSurf, S.Position()));
+    aPOnS.SetParameters(aUSurf, aVSurf, aPS);
+    myPoint2->SetValue(1, aPOnS);
+    mySqDist->SetValue(1, 0.0);
+  } 
 }
 
 
index 059a490d74650cacb9fc9c423abc0313218511c0..fe042f13e3b6fc7aee4d946f2d2f22c936206f23 100644 (file)
@@ -40,12 +40,12 @@ is
        ---C++: inline
        is static;          
     
-    Parameter (me : mutable; theU, theV: Real from Standard; theP : Pnt from gp) 
-       ---Purpose: Sets the params of current POnSurf instance.
-       --         (e.g. to the point to be projected).
-       ---C++: inline
-       is static;          
-    
+    SetParameters(me: in out;
+                  theU, theV: Real from Standard;
+                  thePnt: Pnt from gp);
+      ---Purpose: Sets the params of current POnSurf instance.
+      --          (e.g. to the point to be projected).
+      ---C++: inline    
     
 fields
     myU: Real;
index d0cdb7b15a19e6c5b0d9af1371ad0a4d37cef5f1..fa28d068b3eb700b467b581af5ef7c676b72f209 100644 (file)
@@ -420,7 +420,11 @@ static Standard_Integer extrema(Draw_Interpretor& di, Standard_Integer n, const
         {
         gp_Pnt P1,P2;
         Ex.Points(i,P1,P2);
-        if (P1.Distance(P2) < 1.e-16) continue;
+        if (P1.Distance(P2) < 1.e-16)
+        {
+          di << "Extrema " << i << " is point : " << P1.X() << " " << P1.Y() << " " << P1.Z() << "\n";
+          continue;
+        }
         Handle(Geom_Line) L = new Geom_Line(P1,gp_Vec(P1,P2));
         Handle(Geom_TrimmedCurve) CT = 
           new Geom_TrimmedCurve(L, 0., P1.Distance(P2));
@@ -446,7 +450,11 @@ static Standard_Integer extrema(Draw_Interpretor& di, Standard_Integer n, const
         {
         gp_Pnt P1,P2;
         Ex.Points(i,P1,P2);
-        if (P1.Distance(P2) < 1.e-16) continue;
+        if (P1.Distance(P2) < 1.e-16)
+        {
+          di << "Extrema " << i << " is point : " << P1.X() << " " << P1.Y() << " " << P1.Z() << "\n";
+          continue;
+        }
         Handle(Geom_Line) L = new Geom_Line(P1,gp_Vec(P1,P2));
         Handle(Geom_TrimmedCurve) CT = 
           new Geom_TrimmedCurve(L, 0., P1.Distance(P2));
@@ -473,7 +481,10 @@ static Standard_Integer extrema(Draw_Interpretor& di, Standard_Integer n, const
         gp_Pnt P1,P2;
         Ex.Points(i,P1,P2);
         if (P1.Distance(P2) < 1.e-16)
+        {
+          di << "Extrema " << i << " is point : " << P1.X() << " " << P1.Y() << " " << P1.Z() << "\n";
           continue;
+        }
 
         Handle(Geom_Line) L = new Geom_Line(P1,gp_Vec(P1,P2));
         Handle(Geom_TrimmedCurve) CT = 
index 44e2bcb7d1f68cad92a675930753e5bdb28e7ee5..209df12e065c5bf3625fd354cbbcdef034e707b0 100755 (executable)
@@ -30,10 +30,3 @@ checkreal "length of ext_1" ${ext_1_length} ${good_length} ${tol_abs} ${tol_rel}
 dlog reset
 dlog on
 xdistcs c s 3.140212946671221 3.142972360508366 10
-set Log [dlog get]
-
-set List [split ${Log} {TD= \t\n}]
-set Tolerance 1.0e-6
-set D_good 0.
-set Limit_Tol 1.0e-6
-checkList ${List} ${Tolerance} ${D_good} ${Limit_Tol}
index f39adbff8a60fad9b1b6892f34a566aabc607e5f..66289dc3557d418a8bc564220727c6ca2e66cd0b 100755 (executable)
@@ -19,13 +19,4 @@ set tol_abs 1.0e-6
 set tol_rel 1.0e-6
 checkreal "length of ext_1" ${ext_1_length} ${good_length} ${tol_abs} ${tol_rel}
 
-dlog reset
-dlog on
 xdistcs c s 1.57079 1.5708 10
-set Log [dlog get]
-
-set List [split ${Log} {TD= \t\n}]
-set Tolerance 1.0e-6
-set D_good 0.
-set Limit_Tol 1.0e-6
-checkList ${List} ${Tolerance} ${D_good} ${Limit_Tol}