diff --git a/src/ShapeFix/ShapeFix_ComposeShell.cxx b/src/ShapeFix/ShapeFix_ComposeShell.cxx index cac53faca1..73cf58fe99 100644 --- a/src/ShapeFix/ShapeFix_ComposeShell.cxx +++ b/src/ShapeFix/ShapeFix_ComposeShell.cxx @@ -1594,7 +1594,7 @@ void ShapeFix_ComposeShell::SplitByLine (ShapeFix_SequenceOfWireSegment &wires, // merge null-length tangential segments into one-point tangencies or intersections for ( i = 1; i < SplitLinePar.Length(); i++ ) { - if ( Abs ( SplitLinePar(i+1) - SplitLinePar(i) ) > ::Precision::PConfusion() ) continue; + if ( Abs ( SplitLinePar(i+1) - SplitLinePar(i) ) > ::Precision::PConfusion() && !SplitLineVertex(i).IsSame(SplitLineVertex(i+1)) ) continue; if ( ( SplitLineCode(i) & ITP_ENDSEG && SplitLineCode(i+1) & ITP_BEGSEG ) || ( SplitLineCode(i) & ITP_BEGSEG && @@ -1615,7 +1615,7 @@ void ShapeFix_ComposeShell::SplitByLine (ShapeFix_SequenceOfWireSegment &wires, Standard_Integer tanglevel = 0; // tangency nesting level for ( i = 1; i <= SplitLinePar.Length(); i++ ) { Standard_Integer code = SplitLineCode(i); - Standard_Boolean interior = ( ! tanglevel && parity % 2 ); // create an edge + Standard_Boolean interior = ( !tanglevel && parity % 2 ); // create an edge if ( code & ITP_INTER ) { // crossing parity++; } @@ -2221,9 +2221,10 @@ void ShapeFix_ComposeShell::CollectWires (ShapeFix_SequenceOfWireSegment &wires, wire->Reverse ( myFace ); sbwd->Add ( wire ); } - if ( seg.Orientation() == TopAbs_EXTERNAL ) - seg.Orientation ( reverse ? TopAbs_REVERSED : TopAbs_FORWARD ); - else seg.Orientation ( TopAbs_INTERNAL ); + if ( seg.Orientation() == TopAbs_EXTERNAL ) + seg.Orientation ( reverse ? TopAbs_REVERSED : TopAbs_FORWARD ); + else + seg.Orientation ( TopAbs_INTERNAL ); seqw.SetValue ( index, seg ); } else if ( sbwd.IsNull() ) break; // stop when no free segments available diff --git a/tests/bugs/heal/bug27331 b/tests/bugs/heal/bug27331 new file mode 100644 index 0000000000..1a78bf98c5 --- /dev/null +++ b/tests/bugs/heal/bug27331 @@ -0,0 +1,12 @@ +puts "=======" +puts "OCC27331" +puts "=======" +puts "" +##################################################################### +## FixMissingSeam gives wrong result +##################################################################### + +restore [locate_data_file OCC27331.brep] shape +fixshape result shape 1.e-7 1 + +checkshape result \ No newline at end of file