GeomAdaptor_Surface aGAS(S);
GeomAbs_SurfaceType aSType = aGAS.GetType();
//
+ Standard_Real u1, u2, v1, v2;
+ u1 = aGAS.FirstUParameter();
+ u2 = aGAS.LastUParameter();
+ v1 = aGAS.FirstVParameter();
+ v2 = aGAS.LastVParameter();
+ //
Standard_Real Tol2 = Tol * Tol;
switch (aSType)
{
{
return;
}
- case GeomAbs_Cylinder:
case GeomAbs_SurfaceOfExtrusion:
{
- Standard_Real u1 = aGAS.FirstUParameter(), u2 = aGAS.LastUParameter();
- Standard_Real v1 = aGAS.FirstVParameter();
+ if (Precision::IsInfinite(u1) || Precision::IsInfinite(u2)) {
+ // not closed
+ return;
+ }
+ }
+ case GeomAbs_Cylinder:
+ {
if(Precision::IsInfinite(v1))
v1 = 0.;
gp_Pnt p1 = aGAS.Value(u1, v1);
}
case GeomAbs_Cone:
{
- Standard_Real u1 = aGAS.FirstUParameter(), u2 = aGAS.LastUParameter();
- Standard_Real v1 = aGAS.FirstVParameter(), v2 = aGAS.LastVParameter();
//find v with maximal distance from axis
if(!(Precision::IsInfinite(v1) || Precision::IsInfinite(v2)))
{
}
case GeomAbs_Sphere:
{
- Standard_Real u1 = aGAS.FirstUParameter(), u2 = aGAS.LastUParameter();
- Standard_Real v1 = aGAS.FirstVParameter(), v2 = aGAS.LastVParameter();
//find v with maximal distance from axis
if(v1*v2 <= 0.)
{
{
Standard_Real ures = aGAS.UResolution(Tol);
Standard_Real vres = aGAS.VResolution(Tol);
- Standard_Real u1 = aGAS.FirstUParameter(), u2 = aGAS.LastUParameter();
- Standard_Real v1 = aGAS.FirstVParameter(), v2 = aGAS.LastVParameter();
//
isUClosed = (u2 - u1) >= aGAS.UPeriod() - ures;
isVClosed = (v2 - v1) >= aGAS.VPeriod() - vres;
}
case GeomAbs_BSplineSurface:
{
- Standard_Real u1 = aGAS.FirstUParameter(), u2 = aGAS.LastUParameter();
- Standard_Real v1 = aGAS.FirstVParameter(), v2 = aGAS.LastVParameter();
Handle(Geom_BSplineSurface) aBSpl = aGAS.BSpline();
isUClosed = GeomLib::IsBSplUClosed(aBSpl, u1, u2, Tol);
isVClosed = GeomLib::IsBSplVClosed(aBSpl, v1, v2, Tol);
}
case GeomAbs_BezierSurface:
{
- Standard_Real u1 = aGAS.FirstUParameter(), u2 = aGAS.LastUParameter();
- Standard_Real v1 = aGAS.FirstVParameter(), v2 = aGAS.LastVParameter();
Handle(Geom_BezierSurface) aBz = aGAS.Bezier();
isUClosed = GeomLib::IsBzUClosed(aBz, u1, u2, Tol);
isVClosed = GeomLib::IsBzVClosed(aBz, v1, v2, Tol);
case GeomAbs_OtherSurface:
{
Standard_Integer nbp = 23;
- Standard_Real u1 = aGAS.FirstUParameter(), u2 = aGAS.LastUParameter();
- Standard_Real v1 = aGAS.FirstVParameter(), v2 = aGAS.LastVParameter();
if(Precision::IsInfinite(v1))
{
v1 = Sign(1., v1);