]> OCCT Git - occt-copy.git/commitdiff
0031199: BRepMesh fails on thin faces
authoroan <oan@opencascade.com>
Wed, 4 Dec 2019 09:26:10 +0000 (12:26 +0300)
committerbugmaster <bugmaster@opencascade.com>
Thu, 19 Dec 2019 13:30:06 +0000 (16:30 +0300)
Use real tolerance of a face to define threshold for tolerance of discrete model instead of empirical values based on discrete model itself

26 files changed:
src/BRepMesh/BRepMesh_DefaultRangeSplitter.cxx
tests/bugs/iges/buc60823
tests/bugs/iges/bug306
tests/bugs/mesh/bug23513
tests/bugs/mesh/bug25827
tests/bugs/mesh/bug29962
tests/bugs/mesh/bug31199_1 [new file with mode: 0644]
tests/bugs/mesh/bug31199_2 [new file with mode: 0644]
tests/bugs/mesh/bug31199_3 [new file with mode: 0644]
tests/bugs/mesh/bug31199_4 [new file with mode: 0644]
tests/bugs/moddata_1/bug15519
tests/bugs/moddata_1/bug22759
tests/bugs/moddata_2/bug258_1
tests/bugs/moddata_2/bug428
tests/hlr/poly_hlr/C17
tests/hlr/poly_hlr/C4
tests/hlr/poly_hlr/bug27979_1
tests/hlr/poly_hlr/bug27979_2
tests/hlr/poly_hlr/bug27979_4
tests/hlr/poly_hlr/bug27979_6
tests/mesh/data/advanced/B2
tests/mesh/data/advanced/B3
tests/mesh/data/advanced/B7
tests/mesh/data/standard/H5
tests/mesh/data/standard/M8
tests/mesh/data/standard/P8

index a72cdfec2dc8dc6c42f058f4de9fe0d07ff74d70..ae5041418e2b6d4a586026bc5e8f47eb2bd58eae 100644 (file)
@@ -18,6 +18,7 @@
 #include <GCPnts_AbscissaPoint.hxx>
 #include <GeomAdaptor_Curve.hxx>
 #include <GeomAbs_IsoType.hxx>
+#include <BRep_Tool.hxx>
 
 //=======================================================================
 // Function: Reset
@@ -125,9 +126,14 @@ void BRepMesh_DefaultRangeSplitter::computeTolerance(
   const Standard_Real aDiffU = myRangeU.second - myRangeU.first;
   const Standard_Real aDiffV = myRangeV.second - myRangeV.first;
 
+  const Standard_Real      aTolerance = BRep_Tool::Tolerance (myDFace->GetFace());
+  const Adaptor3d_Surface& aSurface   = GetSurface()->Surface();
+  const Standard_Real      aResU      = aSurface.UResolution (aTolerance);
+  const Standard_Real      aResV      = aSurface.VResolution (aTolerance);
+
   const Standard_Real aDeflectionUV = 1.e-05;
-  myTolerance.first  = Max(Min(aDeflectionUV, 0.1 * aDiffU), 1e-7 * aDiffU);
-  myTolerance.second = Max(Min(aDeflectionUV, 0.1 * aDiffV), 1e-7 * aDiffV);
+  myTolerance.first  = Max(Min(aDeflectionUV, aResU), 1e-7 * aDiffU);
+  myTolerance.second = Max(Min(aDeflectionUV, aResV), 1e-7 * aDiffV);
 }
 
 //=======================================================================
index 4724b1cbc38cafe0553c4f5ad64cd25ca08762a1..b20f3bc60c9140fb4d20bc8a5d94364cc00b0aff 100755 (executable)
@@ -14,6 +14,6 @@ vdisplay result
 vsetdispmode result 1
 vfit
 
-checktrinfo result -tri 2708 -nod 2608
+checktrinfo result -tri 2711 -nod 2611
 
 checkview -display result -2d -path ${imagedir}/${test_image}.png
index 0e844344e34a102dd1b994c088347ef422821697..1e0a1ac19feb356c90563d7b23e86e89df1710e2 100755 (executable)
@@ -20,7 +20,7 @@ vsetdispmode result 1
 vdisplay result
 vfit
 
-checktrinfo result -tri 5812 -nod 5809
+checktrinfo result -tri 5814 -nod 5811
 
 checkmaxtol result -ref 0.92213088179312575
 checknbshapes result -shell 1
index 5c46f1e1a733f539e130480c6347ee37452fd453..ab612f14f39a3eee62530c31d8a106c5478a6cc9 100644 (file)
@@ -12,7 +12,7 @@ vfit
  
 checkview -screenshot -3d -path ${imagedir}/${test_image}.png
 
-checktrinfo result -tri 323648 -nod 161865 -defl 0.00096399964870812682
+checktrinfo result -tri 323820 -nod 161951 -defl 0.00096399964870812682
 
 set log [tricheck result]
 if { [llength $log] != 0 } {
index 365214fdee21d0c04878a502dcc499ce382a4a6e..33d44dd6d31b8d84c2d4cc8f94ad35827bc9c4a9 100644 (file)
@@ -1,4 +1,4 @@
-puts "TODO CR25827 ALL: Faulty shapes in variables faulty_"
+#puts "TODO CR25827 ALL: Faulty shapes in variables faulty_"
 
 puts "========="
 puts "CR25827"
index e9c9c4b96406cd4acb0c3a0c896ff7ebf9583b22..19f65eb8ce293e37b6983cdb14a593efd8b4c532 100644 (file)
@@ -27,7 +27,7 @@ if { [llength $log2] != 0 } {
   puts "Mesh is OK"
 }
 
-checktrinfo result -tri 78186 -nod 39096 -defl 0.035123046705520911
+checktrinfo result -tri 78200 -nod 39103 -defl 0.035123046705520911
 
 don result
 isos result 0
diff --git a/tests/bugs/mesh/bug31199_1 b/tests/bugs/mesh/bug31199_1
new file mode 100644 (file)
index 0000000..89eca7e
--- /dev/null
@@ -0,0 +1,19 @@
+puts "======="
+puts "0031199: BRepMesh fails on thin faces"
+puts "======="
+puts ""
+
+restore [locate_data_file bug31199_ok.brep] result
+
+incmesh result 0.1
+
+checktrinfo result -tri 90 -nod 90
+
+donly result
+triangles result
+isos result 0
+
+top
+fit
+
+checkview -screenshot -2d -path ${imagedir}/${test_image}.png
\ No newline at end of file
diff --git a/tests/bugs/mesh/bug31199_2 b/tests/bugs/mesh/bug31199_2
new file mode 100644 (file)
index 0000000..a67baa8
--- /dev/null
@@ -0,0 +1,19 @@
+puts "======="
+puts "0031199: BRepMesh fails on thin faces"
+puts "======="
+puts ""
+
+restore [locate_data_file bug31199_failure1.brep] result
+
+incmesh result 0.1
+
+checktrinfo result -tri 90 -nod 92
+
+donly result
+triangles result
+isos result 0
+
+top
+fit
+
+checkview -screenshot -2d -path ${imagedir}/${test_image}.png
\ No newline at end of file
diff --git a/tests/bugs/mesh/bug31199_3 b/tests/bugs/mesh/bug31199_3
new file mode 100644 (file)
index 0000000..39e4647
--- /dev/null
@@ -0,0 +1,19 @@
+puts "======="
+puts "0031199: BRepMesh fails on thin faces"
+puts "======="
+puts ""
+
+restore [locate_data_file bug31199_failure2.brep] result
+
+incmesh result 0.1
+
+checktrinfo result -tri 78 -nod 80
+
+donly result
+triangles result
+isos result 0
+
+top
+fit
+
+checkview -screenshot -2d -path ${imagedir}/${test_image}.png
\ No newline at end of file
diff --git a/tests/bugs/mesh/bug31199_4 b/tests/bugs/mesh/bug31199_4
new file mode 100644 (file)
index 0000000..57d75d2
--- /dev/null
@@ -0,0 +1,19 @@
+puts "======="
+puts "0031199: BRepMesh fails on thin faces"
+puts "======="
+puts ""
+
+restore [locate_data_file bug31199_failure3.brep] result
+
+incmesh result 0.1
+
+checktrinfo result -tri 78 -nod 80
+
+donly result
+triangles result
+isos result 0
+
+top
+fit
+
+checkview -screenshot -2d -path ${imagedir}/${test_image}.png
\ No newline at end of file
index d202b6b09e1513914d7c0ac77ebbbac57531ce09..4ea7a145c93b5876c26311b875e8a45e12f3396e 100755 (executable)
@@ -14,5 +14,5 @@ tclean result
 set Deflection 1.
 catch {incmesh result ${Deflection} }
 
-checktrinfo result -tri 52685 -nod 46258 -defl 1.0 -tol_rel_defl 0.001 -tol_rel_tri 0.001 -tol_rel_nod 0.001
+checktrinfo result -tri 52956 -nod 46525 -defl 1.0 -tol_rel_defl 0.001 -tol_rel_tri 0.001 -tol_rel_nod 0.001
 checkview -display result -2d -path ${imagedir}/${test_image}.png
index 1c0ea61ba9614422591e5f2128760d035c497f1a..f03ac3e0a1716b362f10c86df115b8b8a043f08d 100755 (executable)
@@ -19,7 +19,7 @@ tclean result
 set Deflection 0.001
 incmesh result ${Deflection}
 
-checktrinfo result -tri 346096 -nod 176022 -defl 0.0092442421472206764 -tol_rel_defl 0.001 -tol_rel_tri 0.001 -tol_rel_nod 0.001
+checktrinfo result -tri 375392 -nod 190670 -defl 0.0092442421472206764 -tol_rel_defl 0.001 -tol_rel_tri 0.001 -tol_rel_nod 0.001
 
 vinit
 vdisplay result
index 95434f3092d2e3061fa19733d53427ed7447e26b..9290b22b6261e39bca5efb9d3da3d57e5233c314 100755 (executable)
@@ -15,5 +15,5 @@ vsetdispmode result 1
 vfit
 triangles result
 
-checktrinfo result -tri 78 -nod 80
+checktrinfo result -tri 78 -nod 82
 checkview -screenshot -3d -path ${imagedir}/${test_image}.png
index c2bb6f5b7c0f27bbcf9de052ee20932395bc500d..7140f02607083b874a9a53281bbba71141e42fab 100755 (executable)
@@ -19,5 +19,5 @@ isos result 0
 triangles result
 fit
 
-checktrinfo result -tri 10886 -nod 7830
+checktrinfo result -tri 10924 -nod 7869
 checkview -screenshot -2d -path ${imagedir}/${test_image}_axo.png
index 92f75c1b13ce7b0ab1908b29b1629dbf10336255..028db8b5d39a31c6e8cddce2498f75fd5841e1df 100644 (file)
@@ -1,5 +1,5 @@
 set viewname "vright"
-set length 2234.46
+set length 2234.38
 
 testreadstep [locate_data_file bug27341_CCT_PMK_32_L_o_CAD.stp] a
 COMPUTE_HLR $viewname $algotype
index 47ab7b1449e9ddb8296117b0d8638df336890362..38b7efc96651cb5e534ecdc42dd4de066aa13836 100644 (file)
@@ -1,4 +1,4 @@
-puts "TODO OCC30286 ALL: Error : The length of result shape is 2707.46, expected 2765.47"
+puts "TODO OCC30286 ALL: Error : The length of result shape is 2707.33, expected 2765.47"
 
 set viewname "vright"
 set length 2765.47
index e97e89ac6a80f83c15aa31c8da2095286f6d41de..f7c3d0cadf4c80d4e0506576e84bed9b8642fbc5 100644 (file)
@@ -1,4 +1,4 @@
-puts "TODO OCC30286 ALL: Error : The length of result shape is 3.5348, expected 3."
+puts "TODO OCC30286 ALL: Error : The length of result shape is 3.53405, expected 3."
 
 puts "========================================================================"
 puts "OCC27979: Parasolid converted BREP shows weird lines on hidden line Algo"
index 578d43e4e6afd27ffeea1558556ad076c2871db8..67f500ae2007f83724a11932cd63d3f99d8fedbd 100644 (file)
@@ -1,4 +1,4 @@
-puts "TODO OCC30286 ALL: Error : The length of result shape is 12.4882, expected 12."
+puts "TODO OCC30286 ALL: Error : The length of result shape is 12.4883, expected 12."
 
 puts "========================================================================"
 puts "OCC27979: Parasolid converted BREP shows weird lines on hidden line Algo"
index 97f5331630e40d64dfabe284de57bceed5fcf3b8..f626c1ef7f9a6aaf0e87cdb5357da2d394b2733a 100644 (file)
@@ -1,4 +1,4 @@
-puts "TODO OCC30286 ALL: Error : The length of result shape is 11.4456, expected 11."
+puts "TODO OCC30286 ALL: Error : The length of result shape is 11.4458, expected 11."
 
 puts "========================================================================"
 puts "OCC27979: Parasolid converted BREP shows weird lines on hidden line Algo"
index 3181bf388929db9be866f2698b14b57068f0dae5..ec2ad0336032778bd5c23cec30355c8c35e8525a 100644 (file)
@@ -1,4 +1,4 @@
-puts "TODO OCC30286 ALL: Error : The length of result shape is 11.2106, expected 11."
+puts "TODO OCC30286 ALL: Error : The length of result shape is 11.2065, expected 11."
 
 puts "========================================================================"
 puts "OCC27979: Parasolid converted BREP shows weird lines on hidden line Algo"
index 492172e7313fb7c54c728de55528ee36432f66b8..6b8716ed3ec78baa2f117384d9d8ed856734f43f 100755 (executable)
@@ -1,7 +1,7 @@
 set TheFileName OCC22145.stp
 set bug_freenodes "OCC22687"
-set bug_cross "OCC22687"
-set nbcross(ALL) 8
+#set bug_cross "OCC22687"
+#set nbcross(ALL) 8
 if { [string compare $command "shading"] == 0 } {
   set nbfreenodes(ALL) 4
 } else {
index 492172e7313fb7c54c728de55528ee36432f66b8..6b8716ed3ec78baa2f117384d9d8ed856734f43f 100755 (executable)
@@ -1,7 +1,7 @@
 set TheFileName OCC22145.stp
 set bug_freenodes "OCC22687"
-set bug_cross "OCC22687"
-set nbcross(ALL) 8
+#set bug_cross "OCC22687"
+#set nbcross(ALL) 8
 if { [string compare $command "shading"] == 0 } {
   set nbfreenodes(ALL) 4
 } else {
index 6d821b3e3f99ebcb1a5da15d5b178ab483f33acc..74652ac486c33ec126d8e1624298384d18200873 100755 (executable)
@@ -1,8 +1,8 @@
 set TheFileName OCC22302.brep
 set bug_freenodes "OCC22687"
 set bug_area "OCC22687"
-set bug_cross "OCC22687"
-set nbcross(ALL) 8
+#set bug_cross "OCC22687"
+#set nbcross(ALL) 8
 if { [string compare $command "shading"] == 0 } {
   set nbfreenodes(ALL) 4
 } else {
index 9cf10d006083ed28cee25a7b538d715f029536ff..c823258ff3a726a2ac2e1a44a7106be0d15b4a75 100755 (executable)
@@ -1,3 +1,3 @@
 set TheFileName shading_068.brep
-set bug_cross "OCC22687"
-set nbcross(ALL) 2
+#set bug_cross "OCC22687"
+#set nbcross(ALL) 2
index f6dd4877f74d24fe6a4c2105b5aad8b879483e5b..76e189fee312f7809f65062cf656013aa5abc4c9 100755 (executable)
@@ -5,5 +5,5 @@ if { [string compare $command "shading"] == 0 } {
 } else {
   set rel_tol 6.376860334255998
 }
-set bug_freenodes "M8"
-set nbfreenodes(All) 1
+#set bug_freenodes "M8"
+#set nbfreenodes(All) 1
index 8d33688eaeb8bbb43877d65fed7e44d56870b0a5..7fe970633b8bfc8a7c67735042ea63e90ce0d066 100755 (executable)
@@ -1 +1,3 @@
 set TheFileName shading_143.brep
+set bug_freenodes "P8"
+set nbfreenodes(ALL) 2