1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-09-03 14:10:33 +03:00

0025124: [Feature request] Removal of continuity checks for offset geometries

Sometimes curve or surface, which is defined as C0, has continuity G1 or above. Offset can be built from these shapes.
Therefore, this extended checking was added into SetBasisCurve and SetBasisSurface methods.

Main changes in function BRepOffset_Tool::ExtentFace(...):
*  "return" is added if intersection (in 2D-space) between two edges in a face cannot be found.

Basis curve/surface continuity value found (if G1-checking is OK) is set up as BasisContinuity (see myBasisCurveContinuity and myBasisSurfContinuity members which is returned by GetBasisCurveContinuity and GetBasisSurfContinuity() methods). This fact is used in Geom2dAdaptor and in GeomAdaptor classes.

Possibility is entered, which allows for basis elements of offset curve/surface to avoid of C0-checking.

Test cases were changed according to their new behavior.

Test-cases for issue #25124
This commit is contained in:
nbv
2014-12-10 16:18:05 +03:00
committed by bugmaster
parent 68cdb44b0a
commit 3d58dc498b
33 changed files with 1959 additions and 1336 deletions

View File

@@ -61,6 +61,87 @@ Standard_Boolean Geom2d_BSplineCurve::IsCN ( const Standard_Integer N) const
return Standard_False;
}
}
//=======================================================================
//function : IsG1
//purpose :
//=======================================================================
Standard_Boolean Geom2d_BSplineCurve::IsG1 ( const Standard_Real theTf,
const Standard_Real theTl,
const Standard_Real theAngTol) const
{
if(IsCN(1))
{
return Standard_True;
}
Standard_Integer start = FirstUKnotIndex()+1,
finish = LastUKnotIndex()-1;
Standard_Integer aDeg = Degree();
for(Standard_Integer aNKnot = start; aNKnot <= finish; aNKnot++)
{
const Standard_Real aTpar = Knot(aNKnot);
if(aTpar < theTf)
continue;
if(aTpar > theTl)
break;
Standard_Integer mult = Multiplicity(aNKnot);
if (mult < aDeg)
continue;
gp_Pnt2d aP1, aP2;
gp_Vec2d aV1, aV2;
LocalD1(aTpar, aNKnot-1, aNKnot, aP1, aV1);
LocalD1(aTpar, aNKnot, aNKnot+1, aP2, aV2);
if((aV1.SquareMagnitude() <= gp::Resolution()) ||
aV2.SquareMagnitude() <= gp::Resolution())
{
return Standard_False;
}
if(Abs(aV1.Angle(aV2)) > theAngTol)
return Standard_False;
}
if(!IsPeriodic())
return Standard_True;
const Standard_Real aFirstParam = FirstParameter(),
aLastParam = LastParameter();
if( ((aFirstParam - theTf)*(theTl - aFirstParam) < 0.0) &&
((aLastParam - theTf)*(theTl - aLastParam) < 0.0))
{
//Range [theTf, theTl] does not intersect curve bounadries
return Standard_True;
}
//Curve is closed or periodic and range [theTf, theTl]
//intersect curve boundary. Therefore, it is necessary to
//check if curve is smooth in its first and last point.
gp_Pnt2d aP;
gp_Vec2d aV1, aV2;
D1(Knot(FirstUKnotIndex()), aP, aV1);
D1(Knot(LastUKnotIndex()), aP, aV2);
if((aV1.SquareMagnitude() <= gp::Resolution()) ||
aV2.SquareMagnitude() <= gp::Resolution())
{
return Standard_False;
}
if(Abs(aV1.Angle(aV2)) > theAngTol)
return Standard_False;
return Standard_True;
}
//=======================================================================
//function : IsClosed