OCC22576 ShapeFix_Edge::SameParameter() now retains original 3D interval
authorSZY and KGV <>
Fri, 24 Jun 2011 08:31:36 +0000 (08:31 +0000)
committerbugmaster <bugmaster@opencascade.com>
Mon, 5 Mar 2012 15:29:17 +0000 (19:29 +0400)
src/ShapeFix/ShapeFix_Edge.cxx

index 2a1ba51..3170413 100755 (executable)
@@ -751,6 +751,13 @@ Standard_Boolean ShapeFix_Edge::FixSameParameter(const TopoDS_Edge& edge,
        //create copyedge as copy of edge with the same vertices and copy of pcurves on the same surface(s)
        copyedge = ShapeBuild_Edge().Copy ( edge, Standard_False );
        B.SameParameter ( copyedge, Standard_False );
+        // ShapeBuild_Edge::Copy() may change 3D curve range (if it's outside of its period).
+        // In this case pcurves in BRepLib::SameParameter() will be changed as well
+        // and later ShapeBuild_Edge::CopyPCurves() will copy pcurves keeping original range.
+        // To prevent this discrepancy we enforce original 3D range.
+        Standard_Real aF, aL;
+        BRep_Tool::Range (edge, aF, aL);
+        B.Range (copyedge, aF, aL, Standard_True); // only 3D
        BRepLib::SameParameter ( copyedge, ( tolerance >= Precision::Confusion() ? 
                                            tolerance : tol ) );
        SP = BRep_Tool::SameParameter ( copyedge );