mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-14 13:30:48 +03:00
0028724: Extrema between circle and plane cannot be found
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)
This commit is contained in:
@@ -500,10 +500,7 @@ Standard_Boolean Geom2dAdaptor_Curve::IsClosed() const
|
||||
|
||||
Standard_Boolean Geom2dAdaptor_Curve::IsPeriodic() const
|
||||
{
|
||||
if (myCurve->IsPeriodic())
|
||||
return IsClosed();
|
||||
else
|
||||
return Standard_False;
|
||||
return myCurve->IsPeriodic();
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
|
@@ -495,7 +495,7 @@ Standard_Boolean GeomAdaptor_Curve::IsClosed() const
|
||||
|
||||
Standard_Boolean GeomAdaptor_Curve::IsPeriodic() const
|
||||
{
|
||||
return (myCurve->IsPeriodic()? IsClosed() : Standard_False);
|
||||
return myCurve->IsPeriodic();
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
|
@@ -968,9 +968,14 @@ void GeomFill_NSections::GetMinimalWeight(TColStd_Array1OfReal& Weights) const
|
||||
|
||||
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;
|
||||
|
16
tests/bugs/modalg_6/bug28724
Normal file
16
tests/bugs/modalg_6/bug28724
Normal file
@@ -0,0 +1,16 @@
|
||||
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"
|
||||
}
|
Reference in New Issue
Block a user