mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-04-10 18:51:21 +03:00
0027331: Not valid result on translating the file
Added processing of a short segments of a seam edge. Test case added.
This commit is contained in:
parent
aa1b48c7dd
commit
4613a51fd4
@ -1594,7 +1594,7 @@ void ShapeFix_ComposeShell::SplitByLine (ShapeFix_SequenceOfWireSegment &wires,
|
|||||||
|
|
||||||
// merge null-length tangential segments into one-point tangencies or intersections
|
// merge null-length tangential segments into one-point tangencies or intersections
|
||||||
for ( i = 1; i < SplitLinePar.Length(); i++ ) {
|
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 &&
|
if ( ( SplitLineCode(i) & ITP_ENDSEG &&
|
||||||
SplitLineCode(i+1) & ITP_BEGSEG ) ||
|
SplitLineCode(i+1) & ITP_BEGSEG ) ||
|
||||||
( SplitLineCode(i) & ITP_BEGSEG &&
|
( SplitLineCode(i) & ITP_BEGSEG &&
|
||||||
@ -1615,7 +1615,7 @@ void ShapeFix_ComposeShell::SplitByLine (ShapeFix_SequenceOfWireSegment &wires,
|
|||||||
Standard_Integer tanglevel = 0; // tangency nesting level
|
Standard_Integer tanglevel = 0; // tangency nesting level
|
||||||
for ( i = 1; i <= SplitLinePar.Length(); i++ ) {
|
for ( i = 1; i <= SplitLinePar.Length(); i++ ) {
|
||||||
Standard_Integer code = SplitLineCode(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
|
if ( code & ITP_INTER ) { // crossing
|
||||||
parity++;
|
parity++;
|
||||||
}
|
}
|
||||||
@ -2221,9 +2221,10 @@ void ShapeFix_ComposeShell::CollectWires (ShapeFix_SequenceOfWireSegment &wires,
|
|||||||
wire->Reverse ( myFace );
|
wire->Reverse ( myFace );
|
||||||
sbwd->Add ( wire );
|
sbwd->Add ( wire );
|
||||||
}
|
}
|
||||||
if ( seg.Orientation() == TopAbs_EXTERNAL )
|
if ( seg.Orientation() == TopAbs_EXTERNAL )
|
||||||
seg.Orientation ( reverse ? TopAbs_REVERSED : TopAbs_FORWARD );
|
seg.Orientation ( reverse ? TopAbs_REVERSED : TopAbs_FORWARD );
|
||||||
else seg.Orientation ( TopAbs_INTERNAL );
|
else
|
||||||
|
seg.Orientation ( TopAbs_INTERNAL );
|
||||||
seqw.SetValue ( index, seg );
|
seqw.SetValue ( index, seg );
|
||||||
}
|
}
|
||||||
else if ( sbwd.IsNull() ) break; // stop when no free segments available
|
else if ( sbwd.IsNull() ) break; // stop when no free segments available
|
||||||
|
12
tests/bugs/heal/bug27331
Normal file
12
tests/bugs/heal/bug27331
Normal file
@ -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
|
Loading…
x
Reference in New Issue
Block a user