]> OCCT Git - occt-copy.git/commitdiff
0029732: Sewing produces result with high tolerance CR29732
authorgka <gka@opencascade.com>
Thu, 3 May 2018 09:38:14 +0000 (12:38 +0300)
committergka <gka@opencascade.com>
Thu, 3 May 2018 09:38:14 +0000 (12:38 +0300)
Added re-construction  2D curve having shift by parameter relative to 3D curve by projection of the 3D curve on the surface.

src/BRepBuilderAPI/BRepBuilderAPI_Sewing.cxx
src/ShapeAnalysis/ShapeAnalysis_Edge.cxx

index a1734655e595aa2f402b27b39ce0a4820d70a7f5..d3d998b049f7cb85638e153aadfa8e0ff6bb8afc 100644 (file)
 #include <TopTools_ListOfShape.hxx>
 #include <TopTools_MapOfShape.hxx>
 #include <TopTools_SequenceOfShape.hxx>
-#include <ShapeConstruct_ProjectCurveOnSurface.hxx>
 #include <ShapeFix_Edge.hxx>
 #include <ShapeBuild_Edge.hxx>
 #include <ShapeFix_ShapeTolerance.hxx>
@@ -759,7 +758,6 @@ TopoDS_Edge BRepBuilderAPI_Sewing::SameParameterEdge(const TopoDS_Edge& edgeFirs
   else               itf2.Initialize(listFacesFirst);
   Standard_Boolean isResEdge = Standard_False;
   TopoDS_Face fac2;
-
   for (; itf2.More(); itf2.Next()) {
     Handle(Geom2d_Curve) c2d2, c2d21;
     Standard_Real firstOld, lastOld;
@@ -943,8 +941,6 @@ TopoDS_Edge BRepBuilderAPI_Sewing::SameParameterEdge(const TopoDS_Edge& edgeFirs
       for (i = 1; i <= nbp; i++)
         c3dpnt(i) = c3dAdapt.Value(first3d + (i - 1)*deltaT);
 
-
-
       Standard_Real dist = 0., maxTol = -1.0;
       Standard_Boolean more = Standard_True;
 
@@ -1006,8 +1002,8 @@ TopoDS_Edge BRepBuilderAPI_Sewing::SameParameterEdge(const TopoDS_Edge& edgeFirs
       }
       aBuilder.SameParameter(edge, Standard_True);
     }
-
   }
+
   Standard_Real tolEdge1 = BRep_Tool::Tolerance(edge);
   if (tolEdge1 > MaxTolerance()) edge.Nullify();
   return edge;
index 5342e2a924041f8efed99c0311cd1bb61fb5ccf7..c952bea6682dbbc1b0536dc9f7a0e4fe4ae4005b 100644 (file)
@@ -469,8 +469,8 @@ Standard_Boolean ShapeAnalysis_Edge::CheckPoints (const gp_Pnt& P1A,
                                                  const Standard_Real preci2) 
 {
   myStatus = ShapeExtend::EncodeStatus (ShapeExtend_OK);
-  if( (P1A.SquareDistance(P2B) < P1A.SquareDistance(P2A) ) && 
-    ( P1B.SquareDistance(P2A) < P1B.SquareDistance(P2B)) )
+   if (P1A.Distance (P2B) + (P1B.Distance (P2A)) <
+          P1A.Distance (P2A) + (P1B.Distance (P2B)))
  {
     myStatus |= ShapeExtend::EncodeStatus(ShapeExtend_DONE1);
     return Standard_True;