From d30c4db93b7b2398b2375a0fa120cc4bb376169b Mon Sep 17 00:00:00 2001 From: SSV and SZV <> Date: Wed, 20 Jul 2011 12:15:28 +0000 Subject: [PATCH] Correction of OCCT for ACIS22398 --- src/ShapeFix/ShapeFix_ComposeShell.cxx | 21 +++++++++++++++------ src/ShapeFix/ShapeFix_Wire.cxx | 4 +++- 2 files changed, 18 insertions(+), 7 deletions(-) diff --git a/src/ShapeFix/ShapeFix_ComposeShell.cxx b/src/ShapeFix/ShapeFix_ComposeShell.cxx index afb3f9d040..5adcf9767d 100755 --- a/src/ShapeFix/ShapeFix_ComposeShell.cxx +++ b/src/ShapeFix/ShapeFix_ComposeShell.cxx @@ -1463,13 +1463,22 @@ Standard_Boolean ShapeFix_ComposeShell::SplitByLine (ShapeFix_WireSegment &wire, // Two consecutive tangential segments are considered as one, merge them. for ( i=1; i <= IntEdgePar.Length(); i++ ) { j = ( i > 1 ? i-1 : IntEdgePar.Length() ); + + int k = ( i < IntEdgePar.Length() ? i + 1 : 1 ); // [ACIS22539] + if ( SegmentCodes(j) == IOR_UNDEF && - SegmentCodes(i) == IOR_UNDEF ) { - IntEdgeInd.Remove(i); - IntEdgePar.Remove(i); - IntLinePar.Remove(i); - SegmentCodes.Remove(i); - i--; + SegmentCodes(i) == IOR_UNDEF ) { + + // Very specific case when the constructed seam edge + // overlaps with spur edge [ACIS22539] + if (myClosedMode && (IntLinePar(i) - IntLinePar(j)) * (IntLinePar(k) - IntLinePar(i)) <= 0. ) + continue; + + IntEdgeInd.Remove(i); + IntEdgePar.Remove(i); + IntLinePar.Remove(i); + SegmentCodes.Remove(i); + i--; } } } diff --git a/src/ShapeFix/ShapeFix_Wire.cxx b/src/ShapeFix/ShapeFix_Wire.cxx index ea59c53650..e607c71957 100755 --- a/src/ShapeFix/ShapeFix_Wire.cxx +++ b/src/ShapeFix/ShapeFix_Wire.cxx @@ -2986,7 +2986,9 @@ Standard_Boolean ShapeFix_Wire::FixNotchedEdges() if ( ! Context().IsNull() ) UpdateWire(); Handle(ShapeExtend_WireData) sewd = WireData(); - for (Standard_Integer i = 1; i <= NbEdges() && NbEdges() > 2; i++ ) { + for (Standard_Integer i = 1; i <= NbEdges() && NbEdges() >= 2; i++) { + // NbEdges >= 2 -- equality also acceptable (ssv; 16.06.2011; ACIS22569) + Standard_Real param; Standard_Integer toRemove; if(theAdvAnalyzer->CheckNotchedEdges(i,toRemove,param,MinTolerance())){