1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-04-04 18:06:22 +03:00

0029645: Hang on making pipe shell using BRepOffsetAPI_MakePipeShell

Added new boolean parameter to GeomLib::FuseIntervals() to select method of defining an element with close values
This commit is contained in:
akaftasev 2021-05-04 13:28:25 +03:00 committed by bugmaster
parent f5682e9f78
commit da02839efe
5 changed files with 42 additions and 7 deletions

View File

@ -882,7 +882,7 @@ Standard_Real GeomFill_CorrectedFrenet::GetAngleAT(const Standard_Real Param) co
frenet->Intervals(FrenetInt, S);
EvolAroundT->Intervals(LawInt, S);
GeomLib::FuseIntervals(FrenetInt, LawInt, Fusion);
GeomLib::FuseIntervals(FrenetInt, LawInt, Fusion, Precision::PConfusion(), Standard_True);
return Fusion.Length()-1;
}
@ -913,7 +913,7 @@ Standard_Real GeomFill_CorrectedFrenet::GetAngleAT(const Standard_Real Param) co
frenet->Intervals(FrenetInt, S);
EvolAroundT->Intervals(LawInt, S);
GeomLib::FuseIntervals(FrenetInt, LawInt, Fusion);
GeomLib::FuseIntervals(FrenetInt, LawInt, Fusion, Precision::PConfusion(), Standard_True);
for(Standard_Integer i = 1; i <= Fusion.Length(); i++)
T.ChangeValue(i) = Fusion.Value(i);

View File

@ -692,7 +692,7 @@ Standard_Boolean
myCurve->Intervals(TrimInt, tmpS);
TColStd_SequenceOfReal Fusion;
GeomLib::FuseIntervals(TrimInt, mySngl->Array1(), Fusion);
GeomLib::FuseIntervals(TrimInt, mySngl->Array1(), Fusion, Precision::PConfusion(), Standard_True);
return Fusion.Length() - 1;
}
@ -726,7 +726,7 @@ Standard_Boolean
myCurve->Intervals(TrimInt, tmpS);
TColStd_SequenceOfReal Fusion;
GeomLib::FuseIntervals(TrimInt, mySngl->Array1(), Fusion);
GeomLib::FuseIntervals(TrimInt, mySngl->Array1(), Fusion, Precision::PConfusion(), Standard_True);
for (Standard_Integer i = 1; i <= Fusion.Length(); i++)
T.ChangeValue(i) = Fusion.Value(i);

View File

@ -412,7 +412,8 @@ void GeomLib::DensifyArray1OfReal(const Standard_Integer MinNumPoints,
void GeomLib::FuseIntervals(const TColStd_Array1OfReal& I1,
const TColStd_Array1OfReal& I2,
TColStd_SequenceOfReal& Seq,
const Standard_Real Epspar)
const Standard_Real Epspar,
const Standard_Boolean IsAdjustToFirstInterval)
{
Standard_Integer ind1=1, ind2=1;
Standard_Real v1, v2;
@ -429,7 +430,14 @@ void GeomLib::FuseIntervals(const TColStd_Array1OfReal& I1,
v2 = I2(ind2);
if (Abs(v1-v2)<= Epspar) {
// Ici les elements de I1 et I2 conviennent .
Seq.Append((v1+v2)/2);
if (IsAdjustToFirstInterval)
{
Seq.Append(v1);
}
else
{
Seq.Append((v1 + v2) / 2);
}
ind1++;
ind2++;
}

View File

@ -164,7 +164,19 @@ public:
//! non decreasing
Standard_EXPORT static void DensifyArray1OfReal (const Standard_Integer MinNumPoints, const TColStd_Array1OfReal& InParameters, Handle(TColStd_HArray1OfReal)& OutParameters);
Standard_EXPORT static void FuseIntervals (const TColStd_Array1OfReal& Interval1, const TColStd_Array1OfReal& Interval2, TColStd_SequenceOfReal& Fusion, const Standard_Real Confusion = 1.0e-9);
//! This method fuse intervals Interval1 and Interval2 with specified Confusion
//! @param Interval1 [in] first interval to fuse
//! @param Interval2 [in] second interval to fuse
//! @param Confision [in] tolerance to compare intervals
//! @param IsAdjustToFirstInterval [in] flag to set method of fusion, if intervals are close
//! if false, intervals are fusing by half-division methdod
//! if true, intervals are fusing by selecting value from Interval1
//! @param Fusion [out] output interval
Standard_EXPORT static void FuseIntervals (const TColStd_Array1OfReal& Interval1,
const TColStd_Array1OfReal& Interval2,
TColStd_SequenceOfReal& Fusion,
const Standard_Real Confusion = 1.0e-9,
const Standard_Boolean IsAdjustToFirstInterval = Standard_False);
//! this will compute the maximum distance at the
//! parameters given in the Parameters array by

15
tests/pipe/bugs/bug29645 Normal file
View File

@ -0,0 +1,15 @@
puts "========"
puts "0029645: Hang on making pipe shell using BRepOffsetAPI_MakePipeShell"
puts "========"
puts ""
restore [locate_data_file bug29645_spine.brep] spine
restore [locate_data_file bug29645_profile.brep] profile
mksweep spine
addsweep profile
buildsweep result -S -C
puts "TEST COMPLETED"