]> OCCT Git - occt-copy.git/commitdiff
0026651: IntTools_FClass2d gives incorrect result of classification
authorifv <ifv@opencascade.com>
Fri, 11 Sep 2015 11:01:45 +0000 (14:01 +0300)
committerabv <abv@opencascade.com>
Wed, 16 Sep 2015 07:48:30 +0000 (10:48 +0300)
src/Geom2dInt/Geom2dInt_Geom2dCurveTool.cxx
tests/de/step_3/E6
tests/de/step_4/B7
tests/de/step_5/A1

index 8e7c84c1492bf77f4a00ed951beb89089232ba08..f17a951db5d8e0c90a415a36f5a54f9c0edffe00 100644 (file)
@@ -40,7 +40,19 @@ Standard_Integer Geom2dInt_Geom2dCurveTool::NbSamples (const Adaptor2d_Curve2d&
     nbs*= C.Degree();
     Standard_Real anb = t1/t * nbs;
     nbs = (Standard_Integer)anb;
-    if(nbs < 4.0) nbs=4;
+    if(nbs < 4) nbs=4;
+  }
+  else if (typC == GeomAbs_Circle)
+  {
+    //Try to reach deflection = eps*R, eps = 0.01
+    const Standard_Real minR = 1.; //eps = 0.01
+    Standard_Real R = C.Circle().Radius();
+    if(R > minR)
+    {
+      Standard_Real angl = 0.283079; //2.*ACos(1. - eps);
+      Standard_Integer n = RealToInt(Abs(U1 - U0) / angl);
+      nbs = Max(n, nbs);
+    }
   }
 
   if(nbs>300)
@@ -50,7 +62,22 @@ Standard_Integer Geom2dInt_Geom2dCurveTool::NbSamples (const Adaptor2d_Curve2d&
 }
 //============================================================
 Standard_Integer Geom2dInt_Geom2dCurveTool::NbSamples (const Adaptor2d_Curve2d& C) { 
-    return C.NbSamples();
+  Standard_Integer nbs = C.NbSamples();
+  GeomAbs_CurveType typC = C.GetType();
+  if (typC == GeomAbs_Circle)
+  {
+    //Try to reach deflection = eps*R, eps = 0.01
+    const Standard_Real minR = 1.; //eps = 0.01
+    Standard_Real R = C.Circle().Radius();
+    if(R > minR)
+    {
+      Standard_Real angl = 0.283079; //2.*ACos(1. - eps);
+      Standard_Integer n = RealToInt((C.LastParameter()-C.FirstParameter()) / angl);
+      nbs = Max(n, nbs);
+    }
+  }
+
+  return nbs;
  }
 
 
index a988b1f0f3e06d4c38fc36a230465981df112a2d..482157e5632ce9cee24e80ec011d18a6f42a5bfc 100755 (executable)
@@ -8,7 +8,7 @@ set filename Z8M6SAT.stp
 set ref_data {
 DATA        : Faulties = 0  ( 0 )  Warnings = 0  ( 0 )  Summary  = 0  ( 0 )
 TPSTAT      : Faulties = 3  ( 0 )  Warnings = 944  ( 3168 )  Summary  = 947  ( 3168 )
-CHECKSHAPE  : Wires    = 50  ( 41 )  Faces    = 50  ( 46 )  Shells   = 0  ( 2 )   Solids   = 0 ( 0 )
+CHECKSHAPE  : Wires    = 50  ( 41 )  Faces    = 50  ( 48 )  Shells   = 0  ( 2 )   Solids   = 0 ( 0 )
 NBSHAPES    : Solid    = 28  ( 28 )  Shell    = 768  ( 30 )  Face     = 3240  ( 3239 )   Summary  = 29376  ( 28630 )
 STATSHAPE   : Solid    = 28  ( 28 )  Shell    = 768  ( 30 )  Face     = 3240  ( 3239 )   FreeWire = 0  ( 0 )   FreeEdge  = 0 ( 0 )   SharedEdge = 12588  ( 12579 )
 TOLERANCE   : MaxTol   =    15.00300076  (    20.46526799 )  AvgTol   =   0.02278114498  (   0.03744892177 )
index d8e3e17301d4deeb7ab8bfd5d47f0e631f7022ea..aac82034427882a710e691041588619cd8208424 100644 (file)
@@ -4,7 +4,7 @@ set filename Z1MDT6.stp
 set ref_data {
 DATA        : Faulties = 0  ( 0 )  Warnings = 0  ( 0 )  Summary  = 0  ( 0 )
 TPSTAT      : Faulties = 0  ( 0 )  Warnings = 29  ( 195 )  Summary  = 29  ( 195 )
-CHECKSHAPE  : Wires    = 0  ( 0 )  Faces    = 0  ( 1 )  Shells   = 0  ( 0 )   Solids   = 0 ( 0 )
+CHECKSHAPE  : Wires    = 0  ( 0 )  Faces    = 0  ( 2 )  Shells   = 0  ( 0 )   Solids   = 0 ( 0 )
 NBSHAPES    : Solid    = 2  ( 2 )  Shell    = 2  ( 2 )  Face     = 372  ( 372 )   Summary  = 2869  ( 2869 )
 STATSHAPE   : Solid    = 3  ( 3 )  Shell    = 3  ( 3 )  Face     = 384  ( 384 )   FreeWire = 0  ( 0 )   FreeEdge  = 0 ( 0 )   SharedEdge = 1244  ( 1244 )
 TOLERANCE   : MaxTol   = 0.0007170960464  ( 0.0007171032164 )  AvgTol   =  1.914460687e-005  (  2.129229514e-005 )
index 0cdceff1f624b6ed6136f75e9bf1e0bf30585038..1d65d1adcb57a4eb1cc1e02fd0f1ccf15ba78f91 100755 (executable)
@@ -6,10 +6,10 @@ set filename Z8INV5.stp
 set ref_data {
 DATA        : Faulties = 0  ( 0 )  Warnings = 0  ( 0 )  Summary  = 0  ( 0 )
 TPSTAT      : Faulties = 0  ( 0 )  Warnings = 114  ( 619 )  Summary  = 114  ( 619 )
-CHECKSHAPE  : Wires    = 17  ( 17 )  Faces    = 19  ( 19 )  Shells   = 1  ( 1 )   Solids   = 0 ( 0 )
+CHECKSHAPE  : Wires    = 17  ( 17 )  Faces    = 19  ( 20 )  Shells   = 1  ( 1 )   Solids   = 0 ( 0 )
 NBSHAPES    : Solid    = 22  ( 22 )  Shell    = 24  ( 24 )  Face     = 1521  ( 1520 )   Summary  = 11216  ( 11206 )
 STATSHAPE   : Solid    = 22  ( 22 )  Shell    = 24  ( 24 )  Face     = 1521  ( 1520 )   FreeWire = 0  ( 0 )   FreeEdge  = 0 ( 0 )   SharedEdge = 4785  ( 4781 )
-TOLERANCE   : MaxTol   =    12.54913924  (    7.159520237 )  AvgTol   =   0.04320092698  (    0.0322263844 )
+TOLERANCE   : MaxTol   =     7.33063502  (    7.159520237 )  AvgTol   =   0.03499829069  (   0.03222638333 )
 LABELS      : N0Labels = 25  ( 25 )  N1Labels = 23  ( 23 )  N2Labels = 0  ( 0 )   TotalLabels = 48  ( 48 )   NameLabels = 48  ( 48 )   ColorLabels = 0  ( 0 )   LayerLabels = 0  ( 0 )
 PROPS       : Centroid = 0  ( 0 )  Volume   = 0  ( 0 )  Area     = 0  ( 0 )
 NCOLORS     : NColors  = 0  ( 0 )