]> OCCT Git - occt-copy.git/commitdiff
#Temporary changes to force offset make computations on C0 surfaces. CR0-winwerth_1
authormsv <msv@opencascade.com>
Mon, 31 Jul 2017 13:26:00 +0000 (16:26 +0300)
committermsv <msv@opencascade.com>
Mon, 31 Jul 2017 13:26:00 +0000 (16:26 +0300)
src/BRepOffset/BRepOffset_MakeOffset.cxx
src/BRepOffset/BRepOffset_Offset.cxx
src/IntCurveSurface/IntCurveSurface_Polygon.gxx

index 7f22b2261718024aa01ef7c14635cceb05850405..294186db5ca40c03ca1873ab5d65d32e95d72eb7 100644 (file)
@@ -4302,11 +4302,11 @@ Standard_Boolean BRepOffset_MakeOffset::CheckInputData()
     BRepTools::UVBounds(aF, aUmin, aUmax, aVmin, aVmax);
 
     // Continuity check.
-    if (aSurf->Continuity() == GeomAbs_C0)
-    {
-      myError = BRepOffset_C0Geometry;
-      return Standard_False;
-    }
+    //if (aSurf->Continuity() == GeomAbs_C0)
+    //{
+    //  myError = BRepOffset_C0Geometry;
+    //  return Standard_False;
+    //}
 
     // Get degenerated points, to avoid check them.
     NCollection_Vector<gp_Pnt> aBad3dPnts;
@@ -4320,31 +4320,31 @@ Standard_Boolean BRepOffset_MakeOffset::CheckInputData()
       }
     }
 
-    // Geometry grid check.
-    for(Standard_Integer i = 0; i <= aPntPerDim; i++)
-    {
-      Standard_Real aUParam = aUmin + (aUmax - aUmin) * i / aPntPerDim;
-      for(Standard_Integer j = 0; j <= aPntPerDim; j++)
-      {
-        Standard_Real aVParam = aVmin + (aVmax - aVmin) * j / aPntPerDim;
+    //// Geometry grid check.
+    //for(Standard_Integer i = 0; i <= aPntPerDim; i++)
+    //{
+    //  Standard_Real aUParam = aUmin + (aUmax - aUmin) * i / aPntPerDim;
+    //  for(Standard_Integer j = 0; j <= aPntPerDim; j++)
+    //  {
+    //    Standard_Real aVParam = aVmin + (aVmax - aVmin) * j / aPntPerDim;
 
-        myError = checkSinglePoint(aUParam, aVParam, aSurf, aBad3dPnts);
-        if (myError != BRepOffset_NoError)
-          return Standard_False;
-      }
-    }
+    //    myError = checkSinglePoint(aUParam, aVParam, aSurf, aBad3dPnts);
+    //    if (myError != BRepOffset_NoError)
+    //      return Standard_False;
+    //  }
+    //}
 
-    // Vertex list check.
-    TopExp_Explorer anExpFV(aF, TopAbs_VERTEX);
-    for( ; anExpFV.More(); anExpFV.Next())
-    {
-      const TopoDS_Vertex &aV = TopoDS::Vertex(anExpFV.Current());
-      aPnt2d = BRep_Tool::Parameters(aV, aF);
+    //// Vertex list check.
+    //TopExp_Explorer anExpFV(aF, TopAbs_VERTEX);
+    //for( ; anExpFV.More(); anExpFV.Next())
+    //{
+    //  const TopoDS_Vertex &aV = TopoDS::Vertex(anExpFV.Current());
+    //  aPnt2d = BRep_Tool::Parameters(aV, aF);
 
-      myError = checkSinglePoint(aPnt2d.X(), aPnt2d.Y(), aSurf, aBad3dPnts);
-      if (myError != BRepOffset_NoError)
-        return Standard_False;
-    }
+    //  myError = checkSinglePoint(aPnt2d.X(), aPnt2d.Y(), aSurf, aBad3dPnts);
+    //  if (myError != BRepOffset_NoError)
+    //    return Standard_False;
+    //}
   }
 
   return Standard_True;
index b1e8df348c93b4e1d32fed7596d2cf9647e66ea6..976549389ee02705b2e0e841e54b5795427023ca 100644 (file)
@@ -528,8 +528,8 @@ void BRepOffset_Offset::Init(const TopoDS_Face&                  Face,
     if ( !Co->Position().Direct()) myOffset *= -1;
   }
 
-  Handle(Geom_Surface) TheSurf = 
-    BRepOffset::Surface( S, myOffset, myStatus);
+  Handle(Geom_Surface) TheSurf = fabs(myOffset) > gp::Resolution() ?
+    BRepOffset::Surface( S, myOffset, myStatus) : S;
 
   //processing offsets of faces with possible degenerated edges
   Standard_Boolean UminDegen = Standard_False;
index c412b5647a3d97dbe160a51ee8040f61557c52ff..54440968efa640ce528c31ca494c058d2918de11 100644 (file)
@@ -169,11 +169,15 @@ void IntCurveSurface_Polygon::Init(const TheCurve&        C,
       //ddout << "P1 : " << P1.X() << " " << P1.Y() << " " << P1.Z() << endl;
       gp_Pnt P2=ThePnts.Value(i+1);
       //ddout << "P2 : " << P2.X() << " " << P2.Y() << " " << P2.Z() << endl;
-      gp_Lin L(P1,gp_Dir(gp_Vec(P1,P2)));
-      Standard_Real t=L.Distance(Pm);
-      //ddout << "Distance " << t << endl;
-      if(t>TheDeflection) {
-       TheDeflection = t;
+      gp_Vec aV12(P1,P2);
+      if (aV12.SquareMagnitude() > gp::Resolution())
+      {
+        gp_Lin L(P1,gp_Dir());
+        Standard_Real t=L.Distance(Pm);
+        //ddout << "Distance " << t << endl;
+        if(t>TheDeflection) {
+          TheDeflection = t;
+        }
       }
       i++;
     }