mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-04-04 18:06:22 +03:00
0024036: Regression: sewing is not correct
Adding test case for issue CR24036 Loading Draw plugin containing command "freebounds" Loading plugin XDEDRDRW was changed on loading plugin XSDRAW
This commit is contained in:
parent
45e81bbf67
commit
5a29f57e9b
@ -1445,48 +1445,32 @@ Standard_Boolean BRepBuilderAPI_Sewing::FindCandidates(TopTools_SequenceOfShape&
|
||||
}
|
||||
else {
|
||||
const TopoDS_Edge& Edge2 = TopoDS::Edge(seqSections(i));
|
||||
//gka
|
||||
seqSectionsNew.Append(Edge2);
|
||||
seqCandidatesNew.Append(i);
|
||||
/*TopoDS_Shape bnd = Edge2;
|
||||
if (mySectionBound.IsBound(bnd)) bnd = mySectionBound(bnd);
|
||||
//gka
|
||||
if (myBoundFaces.Contains(bnd)) {
|
||||
Standard_Boolean isOK = Standard_True;
|
||||
TopTools_ListIteratorOfListOfShape itf2(myBoundFaces.FindFromKey(bnd));
|
||||
for (; itf2.More() && isOK; itf2.Next()) {
|
||||
const TopoDS_Face& Face2 = TopoDS::Face(itf2.Value());
|
||||
// Check whether condition is satisfied
|
||||
isOK = !Faces1.Contains(Face2);
|
||||
if (!isOK) isOK = IsMergedClosed(Edge1,Edge2,Face2);
|
||||
}
|
||||
if (isOK) {
|
||||
seqSectionsNew.Append(Edge2);
|
||||
seqCandidatesNew.Append(i);
|
||||
}
|
||||
}*/
|
||||
}
|
||||
}
|
||||
|
||||
Standard_Integer nbSectionsNew = seqSectionsNew.Length();
|
||||
if (nbSectionsNew > 1) {
|
||||
|
||||
|
||||
// Evaluate distances between reference and other sections
|
||||
TColStd_Array1OfBoolean arrForward(1,nbSectionsNew);
|
||||
TColStd_Array1OfReal arrDistance(1,nbSectionsNew);
|
||||
TColStd_Array1OfReal arrLen(1,nbSectionsNew);
|
||||
TColStd_Array1OfReal arrMinDist(1,nbSectionsNew);
|
||||
EvaluateDistances(seqSectionsNew,arrForward,arrDistance,arrLen,arrMinDist,1);
|
||||
|
||||
|
||||
// Fill sequence of candidate indices sorted by distance
|
||||
for (i = 2; i <= nbSectionsNew; i++) {
|
||||
if (arrDistance(i) >= 0.0 && arrLen(i) > myMinTolerance) {
|
||||
Standard_Real aMaxDist = arrDistance(i);
|
||||
if (aMaxDist >= 0.0 && aMaxDist <= myTolerance && arrLen(i) > myMinTolerance) {
|
||||
|
||||
// Reference section is connected to section #i
|
||||
Standard_Boolean isInserted = Standard_False;
|
||||
Standard_Integer j, ori = (arrForward(i)? 1 : 0);
|
||||
for (j = 1; (j <= seqCandidates.Length()) && !isInserted; j++) {
|
||||
Standard_Real aDelta = arrDistance(i) - arrDistance(seqCandidates.Value(j));
|
||||
//if (arrDistance(i) <= arrDistance(seqCandidates.Value(j))) {
|
||||
|
||||
if( aDelta < Precision::Confusion()) {
|
||||
|
||||
if(fabs(aDelta) > RealSmall() ||
|
||||
@ -1504,14 +1488,18 @@ Standard_Boolean BRepBuilderAPI_Sewing::FindCandidates(TopTools_SequenceOfShape&
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Replace candidate indices
|
||||
|
||||
nbCandidates = seqCandidates.Length();
|
||||
if (!nbCandidates)
|
||||
return Standard_False; // Section has no candidates to merge
|
||||
|
||||
// Replace candidate indices
|
||||
|
||||
for (i = 1; i <= nbCandidates; i++)
|
||||
seqCandidates(i) = seqCandidatesNew(seqCandidates(i));
|
||||
|
||||
}
|
||||
//}
|
||||
|
||||
|
||||
if (!nbCandidates) return Standard_False; // Section has no candidates to merge
|
||||
|
||||
if (myNonmanifold && nbCandidates >1) {
|
||||
|
@ -14,14 +14,14 @@ sewing result a b -c
|
||||
|
||||
set square 1.8847e+07
|
||||
|
||||
set nb_v_good 779
|
||||
set nb_e_good 1038
|
||||
set nb_v_good 1061
|
||||
set nb_e_good 1255
|
||||
set nb_w_good 273
|
||||
set nb_f_good 259
|
||||
set nb_sh_good 3
|
||||
set nb_sh_good 22
|
||||
set nb_sol_good 0
|
||||
set nb_compsol_good 0
|
||||
set nb_compound_good 1
|
||||
set nb_shape_good 2353
|
||||
set nb_shape_good 2871
|
||||
|
||||
set 3dviewer 0
|
||||
|
@ -1,3 +1,9 @@
|
||||
puts "TODO OCC24036 ALL: Faulty shapes in variables faulty_1 to faulty_2"
|
||||
puts "TODO OCC24036 ALL: Error : Result shape is WRONG because it must contains 642 vertices instead of 966"
|
||||
puts "TODO OCC24036 ALL: Error : Result shape is WRONG because it must contains 955 edges instead of 1224"
|
||||
puts "TODO OCC24036 ALL: Error : Result shape is WRONG because it must contains 3 shells instead of 18"
|
||||
puts "TODO OCC24036 ALL: Error : Result shape is WRONG because it must contains 2133 shapes instead of 2741"
|
||||
|
||||
puts "================"
|
||||
puts "OCC22770"
|
||||
puts "================"
|
||||
|
@ -1,3 +1,9 @@
|
||||
puts "TODO OCC24036 ALL: Faulty shapes in variables faulty_1 to faulty_2"
|
||||
puts "TODO OCC24036 ALL: Error : Result shape is WRONG because it must contains 642 vertices instead of 966"
|
||||
puts "TODO OCC24036 ALL: Error : Result shape is WRONG because it must contains 955 edges instead of 1224"
|
||||
puts "TODO OCC24036 ALL: Error : Result shape is WRONG because it must contains 3 shells instead of 18"
|
||||
puts "TODO OCC24036 ALL: Error : Result shape is WRONG because it must contains 2133 shapes instead of 2741"
|
||||
|
||||
puts "================"
|
||||
puts "OCC22770"
|
||||
puts "================"
|
||||
|
@ -6,6 +6,8 @@ puts ""
|
||||
# (OCC 6.5.3 regression) BRepBuilderAPI_Sewing returns wrong result
|
||||
#######################################################################
|
||||
|
||||
pload XSDRAW
|
||||
|
||||
restore [locate_data_file bug23375_Volute1.brep] v
|
||||
|
||||
explode v
|
||||
@ -23,11 +25,11 @@ if { ${MaxTolerance} > ${CMP_TOL} } {
|
||||
}
|
||||
|
||||
# 3
|
||||
catch {freebounds $result -0.01}
|
||||
freebounds $result -0.01
|
||||
set s [explode result_c e]
|
||||
puts $s
|
||||
set index [ llength $s ]
|
||||
if { $index != 0 } {
|
||||
if { $index != 8 } {
|
||||
puts "Error : Number of free edges is $index"
|
||||
}
|
||||
|
||||
|
34
tests/bugs/modalg_5/bug24036
Normal file
34
tests/bugs/modalg_5/bug24036
Normal file
@ -0,0 +1,34 @@
|
||||
puts "========================"
|
||||
puts "OCC24036"
|
||||
puts "========================"
|
||||
puts ""
|
||||
#######################################################################
|
||||
# Regression: sewing is not correct
|
||||
# (OCC 6.6.0 regression) BRepBuilderAPI_Sewing returns wrong result
|
||||
#######################################################################
|
||||
|
||||
pload XSDRAW
|
||||
|
||||
restore [locate_data_file bug24036_data.brep] v
|
||||
explode v
|
||||
sewing result 0.00001 v_1 v_2
|
||||
|
||||
checkshape result
|
||||
|
||||
set tolmaxres [tolmax result]
|
||||
regexp {max tol = ([-0-9.+eE]+)} $tolmaxres full MaxTolerance
|
||||
set CMP_TOL 1.e-4
|
||||
if { ${MaxTolerance} > ${CMP_TOL} } {
|
||||
puts "Error: invalid tolerance"
|
||||
}
|
||||
|
||||
freebounds $result 0
|
||||
set s [explode result_c e]
|
||||
|
||||
set index [ llength $s ]
|
||||
puts "Number of free edges is $index"
|
||||
if { $index != 2 } {
|
||||
puts "Error : Number of free edges is $index"
|
||||
}
|
||||
|
||||
set 2dviewer 1
|
Loading…
x
Reference in New Issue
Block a user