mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-04-16 10:08:36 +03:00
0024213: bopargcheck complains on sphere
Added check for degenerated edges. Test case for issue CR24213
This commit is contained in:
parent
b2197f9397
commit
9d1c5188ae
@ -304,7 +304,7 @@ void BOPAlgo_ArgumentAnalyzer::TestSelfInterferences()
|
|||||||
Standard_Boolean bSelfInt;
|
Standard_Boolean bSelfInt;
|
||||||
|
|
||||||
for(ii = 0; ii < 2; ii++) {
|
for(ii = 0; ii < 2; ii++) {
|
||||||
TopoDS_Shape aS = (ii == 0) ? myShape1 : myShape2;
|
const TopoDS_Shape& aS = (ii == 0) ? myShape1 : myShape2;
|
||||||
|
|
||||||
if(aS.IsNull())
|
if(aS.IsNull())
|
||||||
continue;
|
continue;
|
||||||
@ -431,7 +431,7 @@ void BOPAlgo_ArgumentAnalyzer::TestSmallEdge()
|
|||||||
aCtx = new BOPInt_Context;
|
aCtx = new BOPInt_Context;
|
||||||
|
|
||||||
for(i = 0; i < 2; i++) {
|
for(i = 0; i < 2; i++) {
|
||||||
TopoDS_Shape aS = (i == 0) ? myShape1 : myShape2;
|
const TopoDS_Shape& aS = (i == 0) ? myShape1 : myShape2;
|
||||||
|
|
||||||
if(aS.IsNull())
|
if(aS.IsNull())
|
||||||
continue;
|
continue;
|
||||||
@ -439,13 +439,16 @@ void BOPAlgo_ArgumentAnalyzer::TestSmallEdge()
|
|||||||
TopExp_Explorer anExp(aS, TopAbs_EDGE);
|
TopExp_Explorer anExp(aS, TopAbs_EDGE);
|
||||||
|
|
||||||
for(; anExp.More(); anExp.Next()) {
|
for(; anExp.More(); anExp.Next()) {
|
||||||
TopoDS_Edge anEdge = TopoDS::Edge(anExp.Current());
|
const TopoDS_Edge& anEdge = *(TopoDS_Edge*)&anExp.Current();
|
||||||
|
if (BRep_Tool::Degenerated(anEdge)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
if(BOPTools_AlgoTools::IsMicroEdge(anEdge, aCtx)) {
|
if(BOPTools_AlgoTools::IsMicroEdge(anEdge, aCtx)) {
|
||||||
Standard_Boolean bKeepResult = Standard_True;
|
Standard_Boolean bKeepResult = Standard_True;
|
||||||
|
|
||||||
if(myOperation == BOPAlgo_SECTION) {
|
if(myOperation == BOPAlgo_SECTION) {
|
||||||
TopoDS_Shape anOtherS = (i == 0) ? myShape2 : myShape1;
|
const TopoDS_Shape& anOtherS = (i == 0) ? myShape2 : myShape1;
|
||||||
|
|
||||||
if(!anOtherS.IsNull()) {
|
if(!anOtherS.IsNull()) {
|
||||||
aDist.LoadS2(anOtherS);
|
aDist.LoadS2(anOtherS);
|
||||||
@ -455,7 +458,7 @@ void BOPAlgo_ArgumentAnalyzer::TestSmallEdge()
|
|||||||
TopExp_Explorer anExpV(anEdge, TopAbs_VERTEX);
|
TopExp_Explorer anExpV(anEdge, TopAbs_VERTEX);
|
||||||
|
|
||||||
for(; anExpV.More(); anExpV.Next()) {
|
for(; anExpV.More(); anExpV.Next()) {
|
||||||
TopoDS_Shape aV = anExpV.Current();
|
const TopoDS_Shape& aV = anExpV.Current();
|
||||||
|
|
||||||
aDist.LoadS1(aV);
|
aDist.LoadS1(aV);
|
||||||
aDist.Perform();
|
aDist.Perform();
|
||||||
@ -463,20 +466,20 @@ void BOPAlgo_ArgumentAnalyzer::TestSmallEdge()
|
|||||||
if(aDist.IsDone()) {
|
if(aDist.IsDone()) {
|
||||||
|
|
||||||
for(ii = 1; ii <= aDist.NbSolution(); ii++) {
|
for(ii = 1; ii <= aDist.NbSolution(); ii++) {
|
||||||
Standard_Real aTolerance = BRep_Tool::Tolerance(TopoDS::Vertex(aV));
|
Standard_Real aTolerance = BRep_Tool::Tolerance(*(TopoDS_Vertex*)&aV);
|
||||||
TopoDS_Shape aSupportShape = aDist.SupportOnShape2(ii);
|
const TopoDS_Shape& aSupportShape = aDist.SupportOnShape2(ii);
|
||||||
|
|
||||||
switch(aSupportShape.ShapeType()) {
|
switch(aSupportShape.ShapeType()) {
|
||||||
case TopAbs_VERTEX: {
|
case TopAbs_VERTEX: {
|
||||||
aTolerance += BRep_Tool::Tolerance(TopoDS::Vertex(aSupportShape));
|
aTolerance += BRep_Tool::Tolerance(*(TopoDS_Vertex*)&(aSupportShape));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case TopAbs_EDGE: {
|
case TopAbs_EDGE: {
|
||||||
aTolerance += BRep_Tool::Tolerance(TopoDS::Edge(aSupportShape));
|
aTolerance += BRep_Tool::Tolerance(*(TopoDS_Edge*)&(aSupportShape));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case TopAbs_FACE: {
|
case TopAbs_FACE: {
|
||||||
aTolerance += BRep_Tool::Tolerance(TopoDS::Face(aSupportShape));
|
aTolerance += BRep_Tool::Tolerance(*(TopoDS_Face*)&(aSupportShape));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
@ -533,7 +536,7 @@ void BOPAlgo_ArgumentAnalyzer::TestRebuildFace()
|
|||||||
Standard_Integer i = 0;
|
Standard_Integer i = 0;
|
||||||
|
|
||||||
for(i = 0; i < 2; i++) {
|
for(i = 0; i < 2; i++) {
|
||||||
TopoDS_Shape aS = (i == 0) ? myShape1 : myShape2;
|
const TopoDS_Shape& aS = (i == 0) ? myShape1 : myShape2;
|
||||||
|
|
||||||
if(aS.IsNull())
|
if(aS.IsNull())
|
||||||
continue;
|
continue;
|
||||||
@ -542,7 +545,7 @@ void BOPAlgo_ArgumentAnalyzer::TestRebuildFace()
|
|||||||
BOPCol_ListOfShape aLS;
|
BOPCol_ListOfShape aLS;
|
||||||
|
|
||||||
for(; anExp.More(); anExp.Next()) {
|
for(; anExp.More(); anExp.Next()) {
|
||||||
TopoDS_Face aFace = TopoDS::Face(anExp.Current());
|
const TopoDS_Face& aFace = *(TopoDS_Face*)&(anExp.Current());
|
||||||
|
|
||||||
TopoDS_Face aFF = aFace;
|
TopoDS_Face aFF = aFace;
|
||||||
aFF.Orientation(TopAbs_FORWARD);
|
aFF.Orientation(TopAbs_FORWARD);
|
||||||
@ -655,7 +658,7 @@ void BOPAlgo_ArgumentAnalyzer::TestTangent()
|
|||||||
BOPCol_MapOfShape aMap1, aMap2;
|
BOPCol_MapOfShape aMap1, aMap2;
|
||||||
|
|
||||||
for(; anExp1.More(); anExp1.Next()) {
|
for(; anExp1.More(); anExp1.Next()) {
|
||||||
TopoDS_Shape aS1 = anExp1.Current();
|
const TopoDS_Shape& aS1 = anExp1.Current();
|
||||||
|
|
||||||
if(aMap1.Contains(aS1))
|
if(aMap1.Contains(aS1))
|
||||||
continue;
|
continue;
|
||||||
@ -664,7 +667,7 @@ void BOPAlgo_ArgumentAnalyzer::TestTangent()
|
|||||||
}
|
}
|
||||||
|
|
||||||
for(; anExp2.More(); anExp2.Next()) {
|
for(; anExp2.More(); anExp2.Next()) {
|
||||||
TopoDS_Shape aS2 = anExp2.Current();
|
const TopoDS_Shape& aS2 = anExp2.Current();
|
||||||
if(aMap2.Contains(aS2))
|
if(aMap2.Contains(aS2))
|
||||||
continue;
|
continue;
|
||||||
aSeq2.Append(aS2);
|
aSeq2.Append(aS2);
|
||||||
@ -678,18 +681,18 @@ void BOPAlgo_ArgumentAnalyzer::TestTangent()
|
|||||||
anArrayOfFlag.SetValue(i, j, Standard_False);
|
anArrayOfFlag.SetValue(i, j, Standard_False);
|
||||||
|
|
||||||
for(i = 1; i <= aSeq1.Length(); i++) {
|
for(i = 1; i <= aSeq1.Length(); i++) {
|
||||||
TopoDS_Shape aS1 = aSeq1.Value(i);
|
const TopoDS_Shape& aS1 = aSeq1.Value(i);
|
||||||
BOPCol_ListOfShape aListOfS2;
|
BOPCol_ListOfShape aListOfS2;
|
||||||
Standard_Integer nbs = 0;
|
Standard_Integer nbs = 0;
|
||||||
|
|
||||||
for(j = 1; j <= aSeq2.Length(); j++) {
|
for(j = 1; j <= aSeq2.Length(); j++) {
|
||||||
TopoDS_Shape aS2 = aSeq2.Value(j);
|
const TopoDS_Shape& aS2 = aSeq2.Value(j);
|
||||||
Standard_Boolean bIsEqual = Standard_False;
|
Standard_Boolean bIsEqual = Standard_False;
|
||||||
|
|
||||||
if(theType == TopAbs_VERTEX) {
|
if(theType == TopAbs_VERTEX) {
|
||||||
|
|
||||||
TopoDS_Vertex aV1 = TopoDS::Vertex(aS1);
|
const TopoDS_Vertex& aV1 = *(TopoDS_Vertex*)&(aS1);
|
||||||
TopoDS_Vertex aV2 = TopoDS::Vertex(aS2);
|
const TopoDS_Vertex& aV2 = *(TopoDS_Vertex*)&(aS2);
|
||||||
gp_Pnt aP1 = BRep_Tool::Pnt(aV1);
|
gp_Pnt aP1 = BRep_Tool::Pnt(aV1);
|
||||||
gp_Pnt aP2 = BRep_Tool::Pnt(aV2);
|
gp_Pnt aP2 = BRep_Tool::Pnt(aV2);
|
||||||
Standard_Real aDist = aP1.Distance(aP2);
|
Standard_Real aDist = aP1.Distance(aP2);
|
||||||
@ -701,8 +704,8 @@ void BOPAlgo_ArgumentAnalyzer::TestTangent()
|
|||||||
else if(theType == TopAbs_EDGE) {
|
else if(theType == TopAbs_EDGE) {
|
||||||
Standard_Integer aDiscretize = 30;
|
Standard_Integer aDiscretize = 30;
|
||||||
Standard_Real aDeflection = 0.01;
|
Standard_Real aDeflection = 0.01;
|
||||||
TopoDS_Edge aE1 = TopoDS::Edge(aS1);
|
const TopoDS_Edge& aE1 = *(TopoDS_Edge*)&(aS1);
|
||||||
TopoDS_Edge aE2 = TopoDS::Edge(aS2);
|
const TopoDS_Edge& aE2 = *(TopoDS_Edge*)&(aS2);
|
||||||
|
|
||||||
IntTools_EdgeEdge aEE;
|
IntTools_EdgeEdge aEE;
|
||||||
aEE.SetEdge1 (aE1);
|
aEE.SetEdge1 (aE1);
|
||||||
@ -767,12 +770,12 @@ void BOPAlgo_ArgumentAnalyzer::TestTangent()
|
|||||||
}
|
}
|
||||||
|
|
||||||
for(i = 1; i <= aSeq2.Length(); i++) {
|
for(i = 1; i <= aSeq2.Length(); i++) {
|
||||||
TopoDS_Shape aS2 = aSeq2.Value(i);
|
const TopoDS_Shape& aS2 = aSeq2.Value(i);
|
||||||
BOPCol_ListOfShape aListOfS1;
|
BOPCol_ListOfShape aListOfS1;
|
||||||
Standard_Integer nbs = 0;
|
Standard_Integer nbs = 0;
|
||||||
|
|
||||||
for(j = 1; j <= aSeq1.Length(); j++) {
|
for(j = 1; j <= aSeq1.Length(); j++) {
|
||||||
TopoDS_Shape aS1 = aSeq1.Value(j);
|
const TopoDS_Shape& aS1 = aSeq1.Value(j);
|
||||||
|
|
||||||
if(anArrayOfFlag.Value(j, i)) {
|
if(anArrayOfFlag.Value(j, i)) {
|
||||||
aListOfS1.Append(aS1);
|
aListOfS1.Append(aS1);
|
||||||
|
17
tests/bugs/modalg_5/bug24213
Normal file
17
tests/bugs/modalg_5/bug24213
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
puts "============"
|
||||||
|
puts "OCC24213"
|
||||||
|
puts "============"
|
||||||
|
puts ""
|
||||||
|
######################################################
|
||||||
|
# bopargcheck complains on sphere
|
||||||
|
######################################################
|
||||||
|
|
||||||
|
psphere s 10
|
||||||
|
|
||||||
|
set info [bopargcheck s #F]
|
||||||
|
|
||||||
|
if { [regexp "to be valid for BOP" ${info}] != 1 } {
|
||||||
|
puts "Error : complain of bopargcheck command is not correct"
|
||||||
|
} else {
|
||||||
|
puts "OK : bopargcheck command work properly"
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user