return GeomAbs_Circle;
default:
- return GeomAbs_OtherCurve;
+ return GeomAbs_OffsetCurve;
}
}
"Adaptor2d_OffsetCurve::BSpline() - wrong curve type");
return myCurve->BSpline();
}
+
+static Standard_Integer nbPoints(const Handle(Adaptor2d_HCurve2d)& theCurve)
+{
+
+ Standard_Integer nbs = 20;
+
+ if (theCurve->GetType() == GeomAbs_Line)
+ nbs = 2;
+ else if (theCurve->GetType() == GeomAbs_BezierCurve)
+ {
+ nbs = 3 + theCurve->NbPoles();
+ }
+ else if (theCurve->GetType() == GeomAbs_BSplineCurve) {
+ nbs = theCurve->NbKnots();
+ nbs *= theCurve->Degree();
+ }
+
+ if (nbs > 200)
+ nbs = 200;
+ return nbs;
+
+}
+//=======================================================================
+//function : NbSamples
+//purpose :
+//=======================================================================
+
+Standard_Integer Adaptor2d_OffsetCurve::NbSamples() const
+{
+ return nbPoints(myCurve);
+}
--- /dev/null
+puts "========"
+puts "0030647: Geom2dGcc_Circ2d2TanRad not giving all the solutions"
+puts "========"
+puts ""
+
+restore [locate_data_file bug30647_curve1_720.brep] c1
+restore [locate_data_file bug30647_curve2_720.brep] c2
+
+explode c1 e
+mk2dcurve q1 c1_1
+explode c2 e
+mk2dcurve q2 c2_1
+
+cirtang r -c q1 -c q2 -r 0.4
+
+smallview -2D-
+
+2dclear q1
+2dfit
+display q1
+
+xwd ${imagedir}/${test_image}.png
+
+set NbCurv [llength [directory r_*]]
+
+if { $NbCurv == 8 } {
+ puts "OK: Number of circles is good"
+} else {
+ puts "Error: Not all solutions"
+}