mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-04-04 18:06:22 +03:00
0021317: Face cannot be fixed by Shape Healing
Fix that face, in which only wire was reordered during shape healing, was not replaced. Add test case for this fix Add status for shifted wires in reordering. Modified test case de/step_1/E3 according to new reference data
This commit is contained in:
parent
773f53f1ec
commit
673693f1cf
@ -594,6 +594,7 @@ Standard_Boolean ShapeAnalysis_Wire::CheckOrder(ShapeAnalysis_WireOrder& sawo,
|
|||||||
case 2: myStatus = ShapeExtend::EncodeStatus (ShapeExtend_DONE2); break;
|
case 2: myStatus = ShapeExtend::EncodeStatus (ShapeExtend_DONE2); break;
|
||||||
case -1: myStatus = ShapeExtend::EncodeStatus (ShapeExtend_DONE3); break;
|
case -1: myStatus = ShapeExtend::EncodeStatus (ShapeExtend_DONE3); break;
|
||||||
case -2: myStatus = ShapeExtend::EncodeStatus (ShapeExtend_DONE4); break;
|
case -2: myStatus = ShapeExtend::EncodeStatus (ShapeExtend_DONE4); break;
|
||||||
|
case 3: myStatus = ShapeExtend::EncodeStatus (ShapeExtend_DONE5); break;//only shifted
|
||||||
case -10: myStatus = ShapeExtend::EncodeStatus (ShapeExtend_FAIL1); break;
|
case -10: myStatus = ShapeExtend::EncodeStatus (ShapeExtend_FAIL1); break;
|
||||||
}
|
}
|
||||||
return LastCheckStatus (ShapeExtend_DONE);
|
return LastCheckStatus (ShapeExtend_DONE);
|
||||||
|
@ -393,8 +393,32 @@ void ShapeAnalysis_WireOrder::Perform(const Standard_Boolean /*closed*/)
|
|||||||
if(stTmp>=0) stTmp = (mainSeq->Value(i) > 0 ? 1 : -1);
|
if(stTmp>=0) stTmp = (mainSeq->Value(i) > 0 ? 1 : -1);
|
||||||
myOrd->SetValue(i,mainSeq->Value(i));
|
myOrd->SetValue(i,mainSeq->Value(i));
|
||||||
}
|
}
|
||||||
|
if (stTmp == 0) {
|
||||||
myStat = stTmp;
|
myStat = stTmp;
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
else {//check if edges were only shifted in reverse or forward, not reordered
|
||||||
|
Standard_Boolean isShiftReverse = Standard_True, isShiftForward = Standard_True;
|
||||||
|
Standard_Integer tmpFirst = 0, tmpSecond = 0, length = mainSeq->Length();
|
||||||
|
for(i = 1; i <= length - 1; i++) {
|
||||||
|
tmpFirst = mainSeq->Value(i);
|
||||||
|
tmpSecond = mainSeq->Value(i+1);
|
||||||
|
if (!(tmpSecond - tmpFirst == 1 || (tmpFirst == length && tmpSecond == 1)))
|
||||||
|
isShiftForward = Standard_False;
|
||||||
|
if (!(tmpFirst - tmpSecond == 1 || (tmpSecond == length && tmpFirst == 1)))
|
||||||
|
isShiftReverse = Standard_False;
|
||||||
|
}
|
||||||
|
tmpFirst = mainSeq->Value(length);
|
||||||
|
tmpSecond = mainSeq->Value(1);
|
||||||
|
if (!(tmpSecond - tmpFirst == 1 || (tmpFirst == length && tmpSecond == 1)))
|
||||||
|
isShiftForward = Standard_False;
|
||||||
|
if (!(tmpFirst - tmpSecond == 1 || (tmpSecond == length && tmpFirst == 1)))
|
||||||
|
isShiftReverse = Standard_False;
|
||||||
|
if (isShiftForward || isShiftReverse)
|
||||||
|
stTmp = 3;
|
||||||
|
myStat = stTmp;
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
|
@ -443,7 +443,7 @@ Standard_Boolean ShapeFix_Face::Perform()
|
|||||||
}
|
}
|
||||||
if ( theAdvFixWire->Perform() ) {
|
if ( theAdvFixWire->Perform() ) {
|
||||||
//fixed = Standard_True;
|
//fixed = Standard_True;
|
||||||
isfixReorder = (theAdvFixWire->StatusReorder(ShapeExtend_DONE) || isfixReorder);
|
isfixReorder = ((theAdvFixWire->StatusReorder(ShapeExtend_DONE) && !theAdvFixWire->StatusReorder(ShapeExtend_DONE5)) || isfixReorder);
|
||||||
fixed = (theAdvFixWire->StatusSmall(ShapeExtend_DONE) ||
|
fixed = (theAdvFixWire->StatusSmall(ShapeExtend_DONE) ||
|
||||||
theAdvFixWire->StatusConnected(ShapeExtend_DONE) ||
|
theAdvFixWire->StatusConnected(ShapeExtend_DONE) ||
|
||||||
theAdvFixWire->StatusEdgeCurves(ShapeExtend_DONE) ||
|
theAdvFixWire->StatusEdgeCurves(ShapeExtend_DONE) ||
|
||||||
@ -477,11 +477,11 @@ Standard_Boolean ShapeFix_Face::Perform()
|
|||||||
if ( ! Context().IsNull() ) Context()->Replace ( S, tmpFace );
|
if ( ! Context().IsNull() ) Context()->Replace ( S, tmpFace );
|
||||||
//myFace = tmpFace;
|
//myFace = tmpFace;
|
||||||
isReplaced = Standard_True;
|
isReplaced = Standard_True;
|
||||||
myStatus |= ShapeExtend::EncodeStatus ( ShapeExtend_DONE1 );
|
|
||||||
|
|
||||||
}
|
}
|
||||||
if(fixed || isfixReorder)
|
if(fixed || isfixReorder) {
|
||||||
myFace = tmpFace;
|
myFace = tmpFace;
|
||||||
|
myStatus |= ShapeExtend::EncodeStatus ( ShapeExtend_DONE1 );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
myResult = myFace;
|
myResult = myFace;
|
||||||
|
@ -441,6 +441,8 @@ Standard_Boolean ShapeFix_Wire::FixReorder()
|
|||||||
myStatusReorder |= ShapeExtend::EncodeStatus ( ShapeExtend_DONE2 );
|
myStatusReorder |= ShapeExtend::EncodeStatus ( ShapeExtend_DONE2 );
|
||||||
if ( sawo.Status() <0 )
|
if ( sawo.Status() <0 )
|
||||||
myStatusReorder |= ShapeExtend::EncodeStatus ( ShapeExtend_DONE3 );
|
myStatusReorder |= ShapeExtend::EncodeStatus ( ShapeExtend_DONE3 );
|
||||||
|
if ( sawo.Status() == 3)
|
||||||
|
myStatusReorder |= ShapeExtend::EncodeStatus ( ShapeExtend_DONE5 );//only shifted
|
||||||
return Standard_True;
|
return Standard_True;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
25
tests/bugs/heal/bug21317
Executable file
25
tests/bugs/heal/bug21317
Executable file
@ -0,0 +1,25 @@
|
|||||||
|
puts "================"
|
||||||
|
puts "OCC21317"
|
||||||
|
puts "================"
|
||||||
|
puts ""
|
||||||
|
######################################################################################
|
||||||
|
# Face cannot be fixed by Shape Healing
|
||||||
|
######################################################################################
|
||||||
|
|
||||||
|
set BugNumber OCC21317
|
||||||
|
|
||||||
|
catch {pload XDE}
|
||||||
|
|
||||||
|
restore [locate_data_file bug21317_faulty.brep] a
|
||||||
|
fixshape result a
|
||||||
|
set info [checkshape result]
|
||||||
|
|
||||||
|
# Resume
|
||||||
|
puts ""
|
||||||
|
if { [regexp {This shape seems to be valid} $info] } {
|
||||||
|
puts "OK ${BugNumber}"
|
||||||
|
} else {
|
||||||
|
puts "Faulty ${BugNumber}"
|
||||||
|
}
|
||||||
|
|
||||||
|
set 2dviewer 0
|
@ -12,9 +12,9 @@ set ref_data {
|
|||||||
DATA : Faulties = 0 ( 0 ) Warnings = 0 ( 0 ) Summary = 0 ( 0 )
|
DATA : Faulties = 0 ( 0 ) Warnings = 0 ( 0 ) Summary = 0 ( 0 )
|
||||||
TPSTAT : Faulties = 0 ( 0 ) Warnings = 21 ( 12 ) Summary = 21 ( 12 )
|
TPSTAT : Faulties = 0 ( 0 ) Warnings = 21 ( 12 ) Summary = 21 ( 12 )
|
||||||
CHECKSHAPE : Wires = 2 ( 0 ) Faces = 2 ( 0 ) Shells = 0 ( 0 ) Solids = 0 ( 0 )
|
CHECKSHAPE : Wires = 2 ( 0 ) Faces = 2 ( 0 ) Shells = 0 ( 0 ) Solids = 0 ( 0 )
|
||||||
NBSHAPES : Solid = 3 ( 4 ) Shell = 4 ( 4 ) Face = 35 ( 35 ) Summary = 292 ( 266 )
|
NBSHAPES : Solid = 4 ( 4 ) Shell = 4 ( 4 ) Face = 35 ( 35 ) Summary = 289 ( 266 )
|
||||||
STATSHAPE : Solid = 3 ( 4 ) Shell = 4 ( 4 ) Face = 35 ( 35 ) FreeWire = 0 ( 0 ) FreeEdge = 24 ( 24 ) SharedEdge = 105 ( 103 )
|
STATSHAPE : Solid = 4 ( 4 ) Shell = 4 ( 4 ) Face = 35 ( 35 ) FreeWire = 0 ( 0 ) FreeEdge = 24 ( 24 ) SharedEdge = 103 ( 103 )
|
||||||
TOLERANCE : MaxTol = 6.104502198e-06 ( 1e-05 ) AvgTol = 9.694977451e-07 ( 2.91037487e-06 )
|
TOLERANCE : MaxTol = 6.104502198e-06 ( 1e-05 ) AvgTol = 9.682983037e-07 ( 2.91037487e-06 )
|
||||||
LABELS : N0Labels = 4 ( 4 ) N1Labels = 31 ( 31 ) N2Labels = 0 ( 0 ) TotalLabels = 35 ( 35 ) NameLabels = 7 ( 7 ) ColorLabels = 0 ( 0 ) LayerLabels = 28 ( 28 )
|
LABELS : N0Labels = 4 ( 4 ) N1Labels = 31 ( 31 ) N2Labels = 0 ( 0 ) TotalLabels = 35 ( 35 ) NameLabels = 7 ( 7 ) ColorLabels = 0 ( 0 ) LayerLabels = 28 ( 28 )
|
||||||
PROPS : Centroid = 0 ( 0 ) Volume = 0 ( 0 ) Area = 0 ( 0 )
|
PROPS : Centroid = 0 ( 0 ) Volume = 0 ( 0 ) Area = 0 ( 0 )
|
||||||
NCOLORS : NColors = 0 ( 0 )
|
NCOLORS : NColors = 0 ( 0 )
|
||||||
|
Loading…
x
Reference in New Issue
Block a user