From: agv Date: Wed, 3 Jul 2019 17:04:16 +0000 (+0300) Subject: 0030831: ShapeFix algorithm (creation of seam edge) takes too long time with thin... X-Git-Url: http://git.dev.opencascade.org/gitweb/?a=commitdiff_plain;h=532383ee8db8f825a5d0b927ccc0a9962a73d990;p=occt-copy.git 0030831: ShapeFix algorithm (creation of seam edge) takes too long time with thin faces In class ShapeFix_ComposeShell the U- and V-closedness of input face is taken immediately avoiding the error when the face is small in any of these dimensions. --- diff --git a/src/ShapeFix/ShapeFix_ComposeShell.cxx b/src/ShapeFix/ShapeFix_ComposeShell.cxx index acfc5f1e62..fe2be6709d 100644 --- a/src/ShapeFix/ShapeFix_ComposeShell.cxx +++ b/src/ShapeFix/ShapeFix_ComposeShell.cxx @@ -30,7 +30,7 @@ #include #include #include -#include +#include #include #include #include @@ -118,26 +118,32 @@ void ShapeFix_ComposeShell::Init (const Handle(ShapeExtend_CompositeSurface) &Gr // DTK-CKY 100531 : protection against very thin face // Test "isclosed" should be filtered on the overall (non trimmed) surface, must be closed Handle(Geom_Surface) theSurface = BRep_Tool::Surface(Face,myLoc); - Standard_Real U0,U1,V0,V1,GU0 = 0.,GU1 = 0.,GV0 = 0.,GV1 = 0.; - theSurface->Bounds(U0,U1,V0,V1); - if (::Precision::IsInfinite (U0) || ::Precision::IsInfinite (U1) || - ::Precision::IsInfinite (V0) || ::Precision::IsInfinite (V1)) - BRepTools::UVBounds(Face, GU0, GU1, GV0, GV1); - if (myUClosed) { - if (::Precision::IsInfinite (V0)) V0 = GV0; - if (::Precision::IsInfinite (V1)) V1 = GV1; - gp_Pnt P0 = theSurface->Value(U0,(V0+V1)/2.); - gp_Pnt P1 = theSurface->Value(U1,(V0+V1)/2.); - if (P0.Distance(P1) > Precision::Confusion()*10) - myUClosed = Standard_False; - } - if (myVClosed) { - if (::Precision::IsInfinite (U0)) U0 = GU0; - if (::Precision::IsInfinite (U1)) U1 = GU1; - gp_Pnt P0 = theSurface->Value((U0+U1)/2.,V0); - gp_Pnt P1 = theSurface->Value((U0+U1)/2.,V1); - if (P0.Distance(P1) > Precision::Confusion()*10) - myVClosed = Standard_False; + // agv 2019/07/03 - avoid false detection of 'Closed' on very thin faces + if (theSurface->IsKind(STANDARD_TYPE(Geom_ElementarySurface))) { + myUClosed = myUClosed && theSurface->IsUClosed(); + myVClosed = myVClosed && theSurface->IsVClosed(); + } else { + Standard_Real U0,U1,V0,V1,GU0 = 0.,GU1 = 0.,GV0 = 0.,GV1 = 0.; + theSurface->Bounds(U0,U1,V0,V1); + if (::Precision::IsInfinite (U0) || ::Precision::IsInfinite (U1) || + ::Precision::IsInfinite (V0) || ::Precision::IsInfinite (V1)) + BRepTools::UVBounds(Face, GU0, GU1, GV0, GV1); + if (myUClosed) { + if (::Precision::IsInfinite (V0)) V0 = GV0; + if (::Precision::IsInfinite (V1)) V1 = GV1; + gp_Pnt P0 = theSurface->Value(U0,(V0+V1)/2.); + gp_Pnt P1 = theSurface->Value(U1,(V0+V1)/2.); + if (P0.Distance(P1) > Precision::Confusion()*10) + myUClosed = Standard_False; + } + if (myVClosed) { + if (::Precision::IsInfinite (U0)) U0 = GU0; + if (::Precision::IsInfinite (U1)) U1 = GU1; + gp_Pnt P0 = theSurface->Value((U0+U1)/2.,V0); + gp_Pnt P1 = theSurface->Value((U0+U1)/2.,V1); + if (P0.Distance(P1) > Precision::Confusion()*10) + myVClosed = Standard_False; + } } // DTK-CKY 100531 end