1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-14 13:30:48 +03:00

0027322: geom/revolution_00/A1: Incorrect pcurve creation

ProjLib_Cone.cxx - correction wrong calculation of projection line on cone
GeomInt_IntSS_1.cxx - modification of method BuildPCurves(...) - adjusting first or last knots of 2d Curve
ProjLib_ComputeApprox.cxx - modification of method Function_SetUVBounds(...) for case projecting line on cone.
Modification of tests - removing first TODO

Test case for issue #27322
This commit is contained in:
ifv
2016-04-07 15:35:39 +03:00
committed by bugmaster
parent 94074ec660
commit 8f8398f6e4
6 changed files with 74 additions and 35 deletions

View File

@@ -1167,12 +1167,28 @@ void GeomInt_IntSS::BuildPCurves (Standard_Real f,
// in class ProjLib_Function the range of parameters is shrank by 1.e-09
if((l - f) > 2.e-09) {
C2d = GeomProjLib::Curve2d(C,f,l,S,umin,umax,vmin,vmax,Tol);
//
if (C2d.IsNull()) {
// proj. a circle that goes through the pole on a sphere to the sphere
Tol += Precision::Confusion();
C2d = GeomProjLib::Curve2d(C,f,l,S,Tol);
}
const Handle(Standard_Type)& aType = C2d->DynamicType();
if ( aType == STANDARD_TYPE(Geom2d_BSplineCurve))
{
//Check first, last knots to avoid problems with trimming
//First, last knots can differ from f, l because of numerical error
//of projection and approximation
//The same checking as in Geom2d_TrimmedCurve
if((C2d->FirstParameter() - f > Precision::PConfusion()) ||
(l - C2d->LastParameter() > Precision::PConfusion()))
{
Handle(Geom2d_BSplineCurve) aBspl = Handle(Geom2d_BSplineCurve)::DownCast(C2d);
TColStd_Array1OfReal aKnots(1, aBspl->NbKnots());
aBspl->Knots(aKnots);
BSplCLib::Reparametrize(f, l, aKnots);
aBspl->SetKnots(aKnots);
}
}
}
else {
if((l - f) > Epsilon(Abs(f)))