1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-24 13:50:49 +03:00

0030597: BRepOffsetAPI_MakePipeShell raises Standard_RangeError

Constructor of GeomFill_SectionPlacement has been corrected: add correction of boundaries of curve to avoid mistake of LocateU in the case when the curve is BSpline.
This commit is contained in:
jgv
2019-04-02 14:14:00 +03:00
committed by bugmaster
parent 74413ca7d3
commit a5278fc126
2 changed files with 34 additions and 0 deletions

View File

@@ -283,6 +283,21 @@ GeomFill_SectionPlacement(const Handle(GeomFill_LocationLaw)& L,
Handle(TColgp_HArray1OfPnt) Pnts;
Standard_Real first = myAdpSection.FirstParameter();
Standard_Real last = myAdpSection.LastParameter();
if (myAdpSection.IsPeriodic())
{
//Correct boundaries to avoid mistake of LocateU
Handle(Geom_Curve) aCurve = myAdpSection.Curve();
if (aCurve->IsInstance(STANDARD_TYPE(Geom_TrimmedCurve)))
aCurve = (Handle(Geom_TrimmedCurve)::DownCast(aCurve))->BasisCurve();
Standard_Real Ufirst = aCurve->FirstParameter();
Standard_Real aPeriod = aCurve->Period();
Standard_Real U1 = Ufirst + Floor((first - Ufirst)/aPeriod) * aPeriod;
Standard_Real U2 = U1 + aPeriod;
if (Abs(first - U1) <= Precision::PConfusion())
first = U1;
if (Abs(last - U2) <= Precision::PConfusion())
last = U2;
}
Standard_Real t, delta;
if (myAdpSection.GetType() == GeomAbs_BSplineCurve)
{