The main reason of the regression is that the Extrema algorithm finds the truth extrema point but cannot adjust it to the range of given circle. It is connected with the fact that Geom(2d)Adaptor_Curve::IsPeriodic() method returns false for given circle because adaptor contains a piece of the circle which is not closed.
New algorithm of IsPeriodic() method will return the information about periodicity of the curve itself (independently of first and last parameter of adaptor).
The documentation about Geom(2d)_TrimmedCurve and Geom_RectangularTrimmedSurface has been updated in frame of the information about IsPeriodic-methods.
(cherry picked from commit
b3cba642626bf141475c6e614fdc1df5e93cfcf7)
Standard_Boolean Geom2dAdaptor_Curve::IsPeriodic() const
{
- if (myCurve->IsPeriodic())
- return IsClosed();
- else
- return Standard_False;
+ return myCurve->IsPeriodic();
}
//=======================================================================
Standard_Boolean GeomAdaptor_Curve::IsPeriodic() const
{
- return (myCurve->IsPeriodic()? IsClosed() : Standard_False);
+ return myCurve->IsPeriodic();
}
//=======================================================================
C1.SetRadius(radius);
Handle(Geom_Curve) C = new (Geom_Circle) (C1);
- if (! AC1.IsPeriodic()) {
- Handle(Geom_Curve) Cbis = new (Geom_TrimmedCurve)
- (C, AC1.FirstParameter(), AC1.LastParameter());
+
+ const Standard_Real aParF = AC1.FirstParameter();
+ const Standard_Real aParL = AC1.LastParameter();
+ const Standard_Real aPeriod = AC1.IsPeriodic() ? AC1.Period() : 0.0;
+
+ if ((aPeriod == 0.0) || (Abs(aParL - aParF - aPeriod) > Precision::PConfusion()))
+ {
+ Handle(Geom_Curve) Cbis = new Geom_TrimmedCurve(C, aParF, aParL);
C = Cbis;
}
return C;
--- /dev/null
+puts "========"
+puts "OCC28724"
+puts "========"
+puts ""
+##############################################
+# Extrema between circle and plane cannot be found
+##############################################
+
+restore [locate_data_file bug28724_cmpd.brep] co
+explode co
+
+distmini d co_1 co_2
+
+if {[dval d_val] > 1.0e-7} {
+ puts "Error: Extrema cannot find minimal distance"
+}
\ No newline at end of file