}
}
+//=======================================================================
+//function : isDegenerated
+//purpose : Check if theAHC2d corresponds to a degenerated edge.
+//=======================================================================
+static Standard_Boolean isDegenerated(const Handle(GeomAdaptor_HSurface)& theGAHS,
+ const Handle(Adaptor2d_HCurve2d)& theAHC2d,
+ const Standard_Real theFirstPar,
+ const Standard_Real theLastPar)
+{
+ const Standard_Real aSqTol = Precision::Confusion()*Precision::Confusion();
+ gp_Pnt2d aP2d;
+ gp_Pnt aP1, aP2;
+
+ theAHC2d->D0(theFirstPar, aP2d);
+ theGAHS->D0(aP2d.X(), aP2d.Y(), aP1);
+
+ theAHC2d->D0(theLastPar, aP2d);
+ theGAHS->D0(aP2d.X(), aP2d.Y(), aP2);
+
+ if(aP1.SquareDistance(aP2) > aSqTol)
+ return Standard_False;
+
+ theAHC2d->D0(0.5*(theFirstPar+theLastPar), aP2d);
+ theGAHS->D0(aP2d.X(), aP2d.Y(), aP2);
+
+ if(aP1.SquareDistance(aP2) > aSqTol)
+ return Standard_False;
+
+ return Standard_True;
+}
+
//=======================================================================
//function : MakeCurve
//purpose :
{
return;
}
+
+ //Restriction line can correspond to a degenerated edge.
+ //In this case we return null-curve.
+ if(isDegenerated(aGAHS, anAHC2d, tf, tl))
+ return;
+
//
//To provide sameparameter it is necessary to get 3d curve as
//approximation of curve on surface.
--- /dev/null
+puts "============"
+puts "OCC27269"
+puts "============"
+puts ""
+###############################
+## Intersection algorithm produces null-length curve
+###############################
+
+
+restore [locate_data_file bug27267_cmpd.brep] a
+explode a f
+
+#############################
+set log [bopcurves a_1 a_7 -2d]
+#############################
+
+regexp {Tolerance Reached=+([-0-9.+eE]+)\n+([-0-9.+eE]+)} ${log} full Toler NbCurv
+
+for {set i 1} {$i <= ${NbCurv}} {incr i} {
+ bounds c_$i U1 U2
+
+ dump U1 U2
+
+ if {[dval U2-U1] < 1.0e-20} {
+ puts "Error: Wrong curve's range!"
+ }
+
+ set le [length c_$i]
+ regexp "The length c_$i is +(\[-0-9.+eE\]+)" ${le} full ll
+
+ if { $ll < 1.0e-7 } {
+ puts "Error: Curve c_$i is too small!"
+ }
+}
+
+