Use real tolerance of a face to define threshold for tolerance of discrete model instead of empirical values based on discrete model itself
#include <GCPnts_AbscissaPoint.hxx>
#include <GeomAdaptor_Curve.hxx>
#include <GeomAbs_IsoType.hxx>
+#include <BRep_Tool.hxx>
//=======================================================================
// Function: Reset
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);
}
//=======================================================================
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
vdisplay result
vfit
-checktrinfo result -tri 5812 -nod 5809
+checktrinfo result -tri 5814 -nod 5811
checkmaxtol result -ref 0.92213088179312575
checknbshapes result -shell 1
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 } {
-puts "TODO CR25827 ALL: Faulty shapes in variables faulty_"
+#puts "TODO CR25827 ALL: Faulty shapes in variables faulty_"
puts "========="
puts "CR25827"
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
--- /dev/null
+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
--- /dev/null
+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
--- /dev/null
+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
--- /dev/null
+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
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
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
vfit
triangles result
-checktrinfo result -tri 78 -nod 80
+checktrinfo result -tri 78 -nod 82
checkview -screenshot -3d -path ${imagedir}/${test_image}.png
triangles result
fit
-checktrinfo result -tri 10886 -nod 7830
+checktrinfo result -tri 10924 -nod 7869
checkview -screenshot -2d -path ${imagedir}/${test_image}_axo.png
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
-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
-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"
-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"
-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"
-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"
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 {
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 {
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 {
set TheFileName shading_068.brep
-set bug_cross "OCC22687"
-set nbcross(ALL) 2
+#set bug_cross "OCC22687"
+#set nbcross(ALL) 2
} else {
set rel_tol 6.376860334255998
}
-set bug_freenodes "M8"
-set nbfreenodes(All) 1
+#set bug_freenodes "M8"
+#set nbfreenodes(All) 1
set TheFileName shading_143.brep
+set bug_freenodes "P8"
+set nbfreenodes(ALL) 2