From: anv Date: Thu, 28 Nov 2019 09:25:20 +0000 (+0300) Subject: 0031202: Shape Healing - FixMissingSeam creates degenerated edge X-Git-Url: http://git.dev.opencascade.org/gitweb/?a=commitdiff_plain;h=930f1577832ad39ed3b2a94afa5cac1a4e19f828;p=occt-copy.git 0031202: Shape Healing - FixMissingSeam creates degenerated edge Adding tolerance to prevent degenerated cuts in cases where all vertex tolerance is covered by distance of the edge curve from vertex point. --- diff --git a/src/ShapeFix/ShapeFix_ComposeShell.cxx b/src/ShapeFix/ShapeFix_ComposeShell.cxx index 9afe4ffa01..042f22e68f 100644 --- a/src/ShapeFix/ShapeFix_ComposeShell.cxx +++ b/src/ShapeFix/ShapeFix_ComposeShell.cxx @@ -979,8 +979,11 @@ ShapeFix_WireSegment ShapeFix_ComposeShell::SplitWire (ShapeFix_WireSegment &wir currPnt = myGrid->Value ( currPnt2d ); if ( currPnt.Distance ( lastVPnt ) <= lastVTol && lastPnt.Distance ( currPnt ) <= tol && + // Tolerance is increased to prevent degenerated cuts in cases where all vertex + // tolerance is covered by distance of the edge curve from vertex point. + // Doubled to prevent edge being fully covered by its vertices tolerance (invalid edge). CheckByCurve3d ( lastVPnt, c3d, f3d+(currPar-firstPar)*(l3d-f3d)/span2d, - T, lastVTol ) && + T, lastVTol + 2 * Precision::Confusion() ) && lastPnt.Distance ( myGrid->Value ( C2d->Value(0.5*(currPar+lastPar)) ) ) <= tol ) { V = lastV; Standard_Real uRes = myUResolution; @@ -999,8 +1002,11 @@ ShapeFix_WireSegment ShapeFix_ComposeShell::SplitWire (ShapeFix_WireSegment &wir } else if ( currPnt.Distance ( prevVPnt ) <= prevVTol && prevPnt.Distance ( currPnt ) <= tol && + // Tolerance is increased to prevent degenerated cuts in cases where all vertex + // tolerance is covered by distance of the edge curve from vertex point. + // Doubled to prevent edge being fully covered by its vertices tolerance (invalid edge). CheckByCurve3d ( prevVPnt, c3d, f3d+(currPar-firstPar)*(l3d-f3d)/span2d, - T, prevVTol ) && + T, prevVTol + 2 * Precision::Confusion()) && prevPnt.Distance ( myGrid->Value ( C2d->Value(0.5*(currPar+prevPar)) ) ) <= tol ) { V = prevV; Standard_Real uRes = myUResolution; diff --git a/tests/bugs/heal/bug31202 b/tests/bugs/heal/bug31202 new file mode 100644 index 0000000000..3af7e65b71 --- /dev/null +++ b/tests/bugs/heal/bug31202 @@ -0,0 +1,4 @@ +restore [locate_data_file bug31202.brep] shape +fixshape result shape 0.000001137 0.0001137 +checkshape result +checknbshapes result -edge 4 \ No newline at end of file diff --git a/tests/de/step_1/E3 b/tests/de/step_1/E3 index 21885a7bc9..c70db7d979 100644 --- a/tests/de/step_1/E3 +++ b/tests/de/step_1/E3 @@ -1,6 +1,5 @@ # !!!! This file is generated automatically, do not edit manually! See end script puts "TODO CR23096 ALL: TPSTAT : Faulty" -puts "TODO CR23096 ALL: CHECKSHAPE : Faulty" set LinuxDiff 2 set filename bm1_sy_exhaust.stp