mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-04-10 18:51:21 +03:00
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. Test case for bug 0030831
This commit is contained in:
parent
3b80dc166a
commit
0cdaa8a4a5
@ -30,7 +30,7 @@
|
|||||||
#include <Geom2dAdaptor_Curve.hxx>
|
#include <Geom2dAdaptor_Curve.hxx>
|
||||||
#include <Geom2dInt_GInter.hxx>
|
#include <Geom2dInt_GInter.hxx>
|
||||||
#include <Geom_Curve.hxx>
|
#include <Geom_Curve.hxx>
|
||||||
#include <Geom_Surface.hxx>
|
#include <Geom_ElementarySurface.hxx>
|
||||||
#include <GeomAdaptor_Surface.hxx>
|
#include <GeomAdaptor_Surface.hxx>
|
||||||
#include <gp_Dir2d.hxx>
|
#include <gp_Dir2d.hxx>
|
||||||
#include <gp_Lin2d.hxx>
|
#include <gp_Lin2d.hxx>
|
||||||
@ -118,26 +118,32 @@ void ShapeFix_ComposeShell::Init (const Handle(ShapeExtend_CompositeSurface) &Gr
|
|||||||
// DTK-CKY 100531 : protection against very thin face
|
// DTK-CKY 100531 : protection against very thin face
|
||||||
// Test "isclosed" should be filtered on the overall (non trimmed) surface, must be closed
|
// Test "isclosed" should be filtered on the overall (non trimmed) surface, must be closed
|
||||||
Handle(Geom_Surface) theSurface = BRep_Tool::Surface(Face,myLoc);
|
Handle(Geom_Surface) theSurface = BRep_Tool::Surface(Face,myLoc);
|
||||||
Standard_Real U0,U1,V0,V1,GU0 = 0.,GU1 = 0.,GV0 = 0.,GV1 = 0.;
|
// avoid false detection of 'Closed' on very thin faces
|
||||||
theSurface->Bounds(U0,U1,V0,V1);
|
if (theSurface->IsKind(STANDARD_TYPE(Geom_ElementarySurface))) {
|
||||||
if (::Precision::IsInfinite (U0) || ::Precision::IsInfinite (U1) ||
|
myUClosed = myUClosed && theSurface->IsUClosed();
|
||||||
::Precision::IsInfinite (V0) || ::Precision::IsInfinite (V1))
|
myVClosed = myVClosed && theSurface->IsVClosed();
|
||||||
BRepTools::UVBounds(Face, GU0, GU1, GV0, GV1);
|
} else {
|
||||||
if (myUClosed) {
|
Standard_Real U0,U1,V0,V1,GU0 = 0.,GU1 = 0.,GV0 = 0.,GV1 = 0.;
|
||||||
if (::Precision::IsInfinite (V0)) V0 = GV0;
|
theSurface->Bounds(U0,U1,V0,V1);
|
||||||
if (::Precision::IsInfinite (V1)) V1 = GV1;
|
if (::Precision::IsInfinite (U0) || ::Precision::IsInfinite (U1) ||
|
||||||
gp_Pnt P0 = theSurface->Value(U0,(V0+V1)/2.);
|
::Precision::IsInfinite (V0) || ::Precision::IsInfinite (V1))
|
||||||
gp_Pnt P1 = theSurface->Value(U1,(V0+V1)/2.);
|
BRepTools::UVBounds(Face, GU0, GU1, GV0, GV1);
|
||||||
if (P0.Distance(P1) > Precision::Confusion()*10)
|
if (myUClosed) {
|
||||||
myUClosed = Standard_False;
|
if (::Precision::IsInfinite (V0)) V0 = GV0;
|
||||||
}
|
if (::Precision::IsInfinite (V1)) V1 = GV1;
|
||||||
if (myVClosed) {
|
gp_Pnt P0 = theSurface->Value(U0,(V0+V1)/2.);
|
||||||
if (::Precision::IsInfinite (U0)) U0 = GU0;
|
gp_Pnt P1 = theSurface->Value(U1,(V0+V1)/2.);
|
||||||
if (::Precision::IsInfinite (U1)) U1 = GU1;
|
if (P0.Distance(P1) > Precision::Confusion()*10)
|
||||||
gp_Pnt P0 = theSurface->Value((U0+U1)/2.,V0);
|
myUClosed = Standard_False;
|
||||||
gp_Pnt P1 = theSurface->Value((U0+U1)/2.,V1);
|
}
|
||||||
if (P0.Distance(P1) > Precision::Confusion()*10)
|
if (myVClosed) {
|
||||||
myVClosed = Standard_False;
|
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
|
// DTK-CKY 100531 end
|
||||||
|
|
||||||
|
12
tests/bugs/heal/bug30831
Normal file
12
tests/bugs/heal/bug30831
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
puts "========================"
|
||||||
|
puts "0030831: Shape Healing - ShapeFix algorithm (creation of seam edge) takes too long time with thin faces"
|
||||||
|
puts "========================"
|
||||||
|
|
||||||
|
cpulimit 10
|
||||||
|
binrestore [locate_data_file bug30831.bin] a
|
||||||
|
|
||||||
|
fixshape r a 1.e-7 1.
|
||||||
|
checkshape r a
|
||||||
|
tolerance r
|
||||||
|
|
||||||
|
checkview -display r -2d -path ${imagedir}/${test_image}.png
|
Loading…
x
Reference in New Issue
Block a user