diff --git a/src/BRepMesh/BRepMesh_NURBSRangeSplitter.cxx b/src/BRepMesh/BRepMesh_NURBSRangeSplitter.cxx index 186eca8059..d0cb22ea67 100644 --- a/src/BRepMesh/BRepMesh_NURBSRangeSplitter.cxx +++ b/src/BRepMesh/BRepMesh_NURBSRangeSplitter.cxx @@ -553,12 +553,17 @@ Handle(IMeshData::SequenceOfReal) BRepMesh_NURBSRangeSplitter::computeGrainAndFi aMinDiff /= theDelta; } - aMinDiff = Max(theParameters.MinSize, aMinDiff); + const Handle(BRepAdaptor_Surface)& aSurface = GetSurface(); + const Standard_Real aMinSize2d = Max( + aSurface->UResolution(theParameters.MinSize), + aSurface->UResolution(theParameters.MinSize)); + + aMinDiff = Max(aMinSize2d, aMinDiff); const Standard_Real aDiffMaxLim = 0.1 * theRangeDiff; const Standard_Real aDiffMinLim = Max(0.005 * theRangeDiff, 2. * theTol2d); - const Standard_Real aDiff = Max(theParameters.MinSize, + const Standard_Real aDiff = Max(aMinSize2d, Min(aDiffMaxLim, aDiffMinLim)); return filterParameters(theSourceParams, aMinDiff, aDiff, theAllocator); } diff --git a/tests/bugs/iges/buc60820_1 b/tests/bugs/iges/buc60820_1 index 9abdd7c07c..3253afd1af 100755 --- a/tests/bugs/iges/buc60820_1 +++ b/tests/bugs/iges/buc60820_1 @@ -12,5 +12,5 @@ tclean result incmesh result 0.1 triangles result -checktrinfo result -tri 736 -nod 613 +checktrinfo result -tri 748 -nod 619 checkview -display result -2d -path ${imagedir}/${test_image}.png diff --git a/tests/bugs/iges/buc60820_2 b/tests/bugs/iges/buc60820_2 index 06cfcf9687..e030c94fcb 100755 --- a/tests/bugs/iges/buc60820_2 +++ b/tests/bugs/iges/buc60820_2 @@ -13,6 +13,6 @@ vdisplay result vsetdispmode result 1 vfit -checktrinfo result -tri 202 -nod 216 +checktrinfo result -tri 278 -nod 254 checkview -display result -2d -path ${imagedir}/${test_image}.png diff --git a/tests/bugs/iges/buc60823 b/tests/bugs/iges/buc60823 index 70902ee48c..13dd8fef4f 100755 --- a/tests/bugs/iges/buc60823 +++ b/tests/bugs/iges/buc60823 @@ -14,6 +14,6 @@ vdisplay result vsetdispmode result 1 vfit -checktrinfo result -tri 3496 -nod 3005 +checktrinfo result -tri 3552 -nod 3033 checkview -display result -2d -path ${imagedir}/${test_image}.png diff --git a/tests/bugs/mesh/bug27384_2 b/tests/bugs/mesh/bug27384_2 index e80517c6e0..640c5ca59a 100644 --- a/tests/bugs/mesh/bug27384_2 +++ b/tests/bugs/mesh/bug27384_2 @@ -17,7 +17,7 @@ vdefaults -autoTriang 0 vdisplay result vfit -set rel_tol 0.6928018366802983 +set rel_tol 0.7607262575544315 set max_rel_tol_diff 0.001 set area_eps 1 diff --git a/tests/bugs/mesh/bug27845 b/tests/bugs/mesh/bug27845 index 6287701923..5428d732a7 100644 --- a/tests/bugs/mesh/bug27845 +++ b/tests/bugs/mesh/bug27845 @@ -14,7 +14,7 @@ vdisplay result vfit checkview -screenshot -3d -path ${imagedir}/${test_image}.png -checktrinfo result -tri 3828 -nod 4771 -defl 3.0544822246414993 -tol_abs_defl 1e-6 +checktrinfo result -tri 3832 -nod 4773 -defl 3.0509255143612428 -tol_abs_defl 1e-6 set log [tricheck result] if { [llength $log] != 0 } { diff --git a/tests/bugs/mesh/bug28247 b/tests/bugs/mesh/bug28247 index 408b30c595..aeaf5888b6 100644 --- a/tests/bugs/mesh/bug28247 +++ b/tests/bugs/mesh/bug28247 @@ -19,7 +19,7 @@ incmesh result 0.59 vdisplay result -redisplay vfit -checktrinfo result -tri 1235 +checktrinfo result -tri 1863 checkview -screenshot -3d -path ${imagedir}/${test_image}-1.png tclean result @@ -27,7 +27,7 @@ incmesh result 0.59 -a 11.45 vdisplay result -redisplay vfit -checktrinfo result -tri 6438 +checktrinfo result -tri 6422 checkview -screenshot -3d -path ${imagedir}/${test_image}-2.png tclean result @@ -35,6 +35,6 @@ incmesh result 0.59 -a 11.45 -min 0.035 vdisplay result -redisplay vfit -checktrinfo result -tri 7079 +checktrinfo result -tri 6427 checkview -screenshot -3d -path ${imagedir}/${test_image}-3.png diff --git a/tests/bugs/mesh/bug29685 b/tests/bugs/mesh/bug29685 index a8cfc3e5a3..12c292d498 100644 --- a/tests/bugs/mesh/bug29685 +++ b/tests/bugs/mesh/bug29685 @@ -16,6 +16,6 @@ if { [llength $log] != 0 } { puts "Mesh is OK" } -checktrinfo result -tri 148 -nod 103 -defl 0.34778084099529977 -tol_abs_defl 1e-6 +checktrinfo result -tri 156 -nod 107 -defl 0.29785837547864635 -tol_abs_defl 1e-6 checkview -screenshot -3d -path ${imagedir}/${test_image}.png diff --git a/tests/bugs/mesh/bug29962 b/tests/bugs/mesh/bug29962 index be507083dd..8845afb25b 100644 --- a/tests/bugs/mesh/bug29962 +++ b/tests/bugs/mesh/bug29962 @@ -15,7 +15,7 @@ if { [llength $log1] != 0 } { puts "Mesh is OK" } -checktrinfo result -tri 2 -nod 4 -defl 5.5579174982152475 -tol_abs_defl 1e-6 +checktrinfo result -tri 344 -nod 175 -defl 48.278808345584679 -tol_abs_defl 1e-6 tclean result incmesh result 0.01 diff --git a/tests/bugs/mesh/bug30008_1 b/tests/bugs/mesh/bug30008_1 index 034531a702..add7ddfaab 100644 --- a/tests/bugs/mesh/bug30008_1 +++ b/tests/bugs/mesh/bug30008_1 @@ -12,6 +12,6 @@ vdisplay result vviewparams -scale 8.46292 -proj 0.653203 -0.644806 0.396926 -up -0.0109833 0.51609 0.856464 -at 347.559 1026.89 219.262 -eye 2080.75 -684.022 1272.45 tricheck result -checktrinfo result -tri 6996 -nod 4899 -defl 8.4394056682382157 -tol_abs_defl 1e-6 +checktrinfo result -tri 9470 -nod 6136 -defl 4.7757836297551908 -tol_abs_defl 1e-6 checkview -screenshot -3d -path ${imagedir}/${test_image}.png diff --git a/tests/bugs/mesh/bug30442 b/tests/bugs/mesh/bug30442 new file mode 100644 index 0000000000..3744389850 --- /dev/null +++ b/tests/bugs/mesh/bug30442 @@ -0,0 +1,25 @@ +puts "=======" +puts "0030442: Mesh - broken triangulation on pipe shape" +puts "=======" +puts "" + +bsmooth aSmoothCurve 1.0 [locate_data_file bug30442_points.txt] + +circle aCircle 0 0 0 1 1 1 20 + +mkedge aSpineEdge aSmoothCurve +mkedge aProfileEdge aCircle + +wire aSpineWire aSpineEdge +wire aProfileWire aProfileEdge + +pipe result aSpineWire aProfileWire + +vinit View1 +vdisplay result +vsetdispmode 1 +vfit + +checktrinfo result -tri 25814 -nod 12955 + +checkview -screenshot -3d -path ${imagedir}/${test_image}.png diff --git a/tests/bugs/mesh/bug31251 b/tests/bugs/mesh/bug31251 index d1af096e35..d8693fe8e2 100644 --- a/tests/bugs/mesh/bug31251 +++ b/tests/bugs/mesh/bug31251 @@ -15,7 +15,7 @@ vdefaults -autoTriang 0 tclean result incmesh result 0.004 -a 14 -checktrinfo result -tri 72522 -nod 40927 -defl 0.24607185555570676 -tol_abs_defl 1e-6 +checktrinfo result -tri 72570 -nod 40951 -defl 0.24607185555570676 -tol_abs_defl 1e-6 vdisplay result -redisplay vfit @@ -23,7 +23,7 @@ checkview -screenshot -3d -path ${imagedir}/${test_image}_default.png tclean result incmesh result 0.004 -a 14 -force_face_def -checktrinfo result -tri 288022 -nod 148677 -defl 0.16388671063364907 -tol_abs_defl 1e-6 +checktrinfo result -tri 287990 -nod 148661 -defl 0.16388671063364907 -tol_abs_defl 1e-6 vdisplay result -redisplay vfit diff --git a/tests/bugs/mesh/bug31853 b/tests/bugs/mesh/bug31853 new file mode 100644 index 0000000000..a309192618 --- /dev/null +++ b/tests/bugs/mesh/bug31853 @@ -0,0 +1,17 @@ +puts "=======" +puts "0031853: Mesh - holes in triangulation with large linear deflection" +puts "=======" +puts "" + +pload MODELING XDE VISUALIZATION + +testreadstep [locate_data_file bug31853_WR16-30.step] result + +incmesh result 1 -a 6 +checktrinfo result -tri 142834 -nod 72496 + +vinit View1 +vdefaults -autoTriang 0 +vdisplay -dispMode 1 result +vfit +checkview -screenshot -3d -path ${imagedir}/${test_image}.png diff --git a/tests/bugs/mesh/bug32241 b/tests/bugs/mesh/bug32241 index 9eab9b1b25..90b826a019 100644 --- a/tests/bugs/mesh/bug32241 +++ b/tests/bugs/mesh/bug32241 @@ -3,6 +3,14 @@ puts "0032241: Mesh - wrong shading display of thrusections" puts "========" puts "" +if { [regexp {Windows} [dversion]] } { + set tri_n 2702 + set nod_n 1399 +} else { + set tri_n 2766 + set nod_n 1431 +} + pload MODELING VISUALIZATION circle c0 0 0 0 0 0 1 30 @@ -28,4 +36,4 @@ thrusections result issolid w0 w1 w2 w3 w4 checkview -display result -3d -path ${imagedir}/${test_image}.png -checktrinfo result -tri 2744 -nod 1420 +checktrinfo result -tri $tri_n -nod $nod_n diff --git a/tests/bugs/modalg_2/bug264_0 b/tests/bugs/modalg_2/bug264_0 index 8816be638a..95078bc7cd 100755 --- a/tests/bugs/modalg_2/bug264_0 +++ b/tests/bugs/modalg_2/bug264_0 @@ -15,6 +15,6 @@ vclear isos result 0 triangles result -checktrinfo result -tri 14 -nod 14 +checktrinfo result -tri 26 -nod 20 checkprops result -s 1.3135 checkview -display result -3d -path ${imagedir}/${test_image}.png diff --git a/tests/bugs/modalg_2/bug264_11 b/tests/bugs/modalg_2/bug264_11 index eda4fb2af3..a733dbcb47 100755 --- a/tests/bugs/modalg_2/bug264_11 +++ b/tests/bugs/modalg_2/bug264_11 @@ -18,6 +18,6 @@ vclear isos result 0 triangles result -checktrinfo result -tri 55 -nod 40 +checktrinfo result -tri 31 -nod 28 checkprops result -s 0 checkview -display result -3d -path ${imagedir}/${test_image}.png diff --git a/tests/bugs/modalg_2/bug292 b/tests/bugs/modalg_2/bug292 index dbb567ff41..f0f9ad97dc 100755 --- a/tests/bugs/modalg_2/bug292 +++ b/tests/bugs/modalg_2/bug292 @@ -19,6 +19,6 @@ vsetdispmode result 1 isos result 0 triangles result -checktrinfo result -tri 14 -nod 14 +checktrinfo result -tri 26 -nod 20 checkprops result -s 1.3135 checkview -display result -3d -path ${imagedir}/${test_image}.png diff --git a/tests/bugs/moddata_1/bug15519 b/tests/bugs/moddata_1/bug15519 index d7ade0deef..639785f18a 100755 --- a/tests/bugs/moddata_1/bug15519 +++ b/tests/bugs/moddata_1/bug15519 @@ -14,5 +14,5 @@ tclean result set Deflection 1. catch {incmesh result ${Deflection} } -checktrinfo result -tri 59881 -nod 49987 -defl 1.6213275001104823 -tol_rel_defl 0.001 -tol_rel_tri 0.001 -tol_rel_nod 0.001 +checktrinfo result -tri 60069 -nod 50081 -defl 1.6213275001104823 -tol_rel_defl 0.001 -tol_rel_tri 0.001 -tol_rel_nod 0.001 checkview -display result -2d -path ${imagedir}/${test_image}.png diff --git a/tests/bugs/moddata_2/bug428 b/tests/bugs/moddata_2/bug428 index db0bba7e45..d4cce3e9f8 100755 --- a/tests/bugs/moddata_2/bug428 +++ b/tests/bugs/moddata_2/bug428 @@ -19,5 +19,5 @@ isos result 0 triangles result fit -checktrinfo result -tri 7769 -nod 6295 +checktrinfo result -tri 10463 -nod 7643 checkview -screenshot -2d -path ${imagedir}/${test_image}_axo.png diff --git a/tests/bugs/moddata_2/fra62476_2 b/tests/bugs/moddata_2/fra62476_2 index feebf5b4a4..a9c53d81e0 100755 --- a/tests/bugs/moddata_2/fra62476_2 +++ b/tests/bugs/moddata_2/fra62476_2 @@ -13,5 +13,5 @@ tclean result incmesh result .1 triangles result -checktrinfo result -tri 335 -nod 200 +checktrinfo result -tri 163 -nod 114 checkview -display result -3d -path ${imagedir}/${test_image}.png diff --git a/tests/de_mesh/shape_write_stl/A4 b/tests/de_mesh/shape_write_stl/A4 index 706db284cd..f413f878c2 100644 --- a/tests/de_mesh/shape_write_stl/A4 +++ b/tests/de_mesh/shape_write_stl/A4 @@ -9,7 +9,7 @@ writestl m $imagedir/${casename} readstl res $imagedir/${casename} file delete $imagedir/${casename} -checktrinfo res -tri 110 -nod 57 +checktrinfo res -tri 116 -nod 60 # Visual check checkview -display res -2d -path ${imagedir}/${test_image}.png diff --git a/tests/hlr/poly_hlr/C12 b/tests/hlr/poly_hlr/C12 index 69baa1a86d..fc3d46b17f 100644 --- a/tests/hlr/poly_hlr/C12 +++ b/tests/hlr/poly_hlr/C12 @@ -1,5 +1,5 @@ set viewname "vright" -set length 516.649 +set length 516.281 testreadstep [locate_data_file bug27341_Adapter_Zylinder_2_CAD.stp] a COMPUTE_HLR $viewname $algotype diff --git a/tests/hlr/poly_hlr/C13 b/tests/hlr/poly_hlr/C13 index 3b9c705210..bd4cf9a1cc 100644 --- a/tests/hlr/poly_hlr/C13 +++ b/tests/hlr/poly_hlr/C13 @@ -1,5 +1,5 @@ set viewname "vright" -set length 9546.99 +set length 9548.13 testreadstep [locate_data_file bug27341_Assembly_ABS_1_CAD.stp] a COMPUTE_HLR $viewname $algotype diff --git a/tests/hlr/poly_hlr/C14 b/tests/hlr/poly_hlr/C14 index 7d32bbf757..c49df14909 100644 --- a/tests/hlr/poly_hlr/C14 +++ b/tests/hlr/poly_hlr/C14 @@ -1,5 +1,5 @@ set viewname "vright" -set length 5502.06 +set length 5497.6 testreadstep [locate_data_file bug27341_Assembly_BILZ_WFL2_1_CAD.stp] a COMPUTE_HLR $viewname $algotype diff --git a/tests/hlr/poly_hlr/C15 b/tests/hlr/poly_hlr/C15 index 526f80eca3..804df0c48f 100644 --- a/tests/hlr/poly_hlr/C15 +++ b/tests/hlr/poly_hlr/C15 @@ -1,5 +1,5 @@ set viewname "vright" -set length 5102.18 +set length 5101.26 testreadstep [locate_data_file bug27341_Assembly_GMS_Kurz_CAD.stp] a COMPUTE_HLR $viewname $algotype diff --git a/tests/hlr/poly_hlr/C16 b/tests/hlr/poly_hlr/C16 index 4c2ecbe5c2..21f8c48b6c 100644 --- a/tests/hlr/poly_hlr/C16 +++ b/tests/hlr/poly_hlr/C16 @@ -1,5 +1,5 @@ set viewname "vright" -set length 1662.85 +set length 1662.87 testreadstep [locate_data_file bug27341_CCS_Adapter_CAD.stp] a COMPUTE_HLR $viewname $algotype diff --git a/tests/hlr/poly_hlr/C17 b/tests/hlr/poly_hlr/C17 index bca493e4e6..f89ae7c2a2 100644 --- a/tests/hlr/poly_hlr/C17 +++ b/tests/hlr/poly_hlr/C17 @@ -1,5 +1,5 @@ set viewname "vright" -set length 2239.23 +set length 2239.26 testreadstep [locate_data_file bug27341_CCT_PMK_32_L_o_CAD.stp] a COMPUTE_HLR $viewname $algotype diff --git a/tests/hlr/poly_hlr/C20 b/tests/hlr/poly_hlr/C20 index aa685c0767..0697995c73 100644 --- a/tests/hlr/poly_hlr/C20 +++ b/tests/hlr/poly_hlr/C20 @@ -1,5 +1,5 @@ set viewname "vright" -set length 1704.87 +set length 1704.6 testreadstep [locate_data_file bug27341_Drehkopf_HSK_Gewinde_R_CAD.stp] a COMPUTE_HLR $viewname $algotype diff --git a/tests/hlr/poly_hlr/C4 b/tests/hlr/poly_hlr/C4 index be7953c784..dd6b6c582f 100644 --- a/tests/hlr/poly_hlr/C4 +++ b/tests/hlr/poly_hlr/C4 @@ -1,7 +1,5 @@ -puts "TODO OCC30286 ALL: Error : The length of result shape is 2705.91, expected 2765.47" - set viewname "vright" -set length 2765.47 +set length 2711.37 testreadstep [locate_data_file bug27341_82-01_Solid_End_Mill_Radius_with_Shrink_Fit_and_extension_HeavyModel.stp] a COMPUTE_HLR $viewname $algotype diff --git a/tests/hlr/poly_hlr/C5 b/tests/hlr/poly_hlr/C5 index 8213d96e56..140df6fbfd 100644 --- a/tests/hlr/poly_hlr/C5 +++ b/tests/hlr/poly_hlr/C5 @@ -1,7 +1,5 @@ -puts "TODO OCC30286 ALL: Error : The length of result shape is 1723.\\d+, expected 1721.69" - set viewname "vright" -set length 1721.69 +set length 1718.9 testreadstep [locate_data_file bug27341_ABS_Adapter_CAD.stp] a COMPUTE_HLR $viewname $algotype diff --git a/tests/hlr/poly_hlr/C6 b/tests/hlr/poly_hlr/C6 index e149469bd2..b63823c549 100644 --- a/tests/hlr/poly_hlr/C6 +++ b/tests/hlr/poly_hlr/C6 @@ -1,5 +1,5 @@ set viewname "vright" -set length 2832.69 +set length 2832.05 testreadstep [locate_data_file bug27341_ABS_Grundhalter_CAD.stp] a COMPUTE_HLR $viewname $algotype diff --git a/tests/hlr/poly_hlr/C7 b/tests/hlr/poly_hlr/C7 index 471a9cd4ef..76688f7cad 100644 --- a/tests/hlr/poly_hlr/C7 +++ b/tests/hlr/poly_hlr/C7 @@ -1,5 +1,5 @@ set viewname "vright" -set length 2261.22 +set length 2261.81 testreadstep [locate_data_file bug27341_AIF_Grundhalter_GR1_CAD.stp] a COMPUTE_HLR $viewname $algotype diff --git a/tests/hlr/poly_hlr/bug23625_1 b/tests/hlr/poly_hlr/bug23625_1 index 49d3709ec7..598634bec4 100644 --- a/tests/hlr/poly_hlr/bug23625_1 +++ b/tests/hlr/poly_hlr/bug23625_1 @@ -6,7 +6,7 @@ puts "" puts "REQUIRED All: Meshing statuses: SelfIntersectingWire Failure" set viewname "vfront" -set length 26881.1 +set length 26411.7 restore [locate_data_file bug23625_a1.brep] a diff --git a/tests/hlr/poly_hlr/bug23625_2 b/tests/hlr/poly_hlr/bug23625_2 index af647e97e0..8ae9139745 100644 --- a/tests/hlr/poly_hlr/bug23625_2 +++ b/tests/hlr/poly_hlr/bug23625_2 @@ -4,7 +4,7 @@ puts "============" puts "" set viewname "vfront" -set length 27461.9 +set length 27126.9 restore [locate_data_file bug23625_a2.brep] a COMPUTE_HLR $viewname $algotype diff --git a/tests/hlr/poly_hlr/bug23625_3 b/tests/hlr/poly_hlr/bug23625_3 index 904e40f261..2ea799431c 100644 --- a/tests/hlr/poly_hlr/bug23625_3 +++ b/tests/hlr/poly_hlr/bug23625_3 @@ -4,7 +4,7 @@ puts "============" puts "" set viewname "vtop" -set length 19259.1 +set length 19649 restore [locate_data_file bug23625_a3.brep] a COMPUTE_HLR $viewname $algotype diff --git a/tests/hlr/poly_hlr/bug27979_2 b/tests/hlr/poly_hlr/bug27979_2 index 295b0b06ac..a5df15c581 100644 --- a/tests/hlr/poly_hlr/bug27979_2 +++ b/tests/hlr/poly_hlr/bug27979_2 @@ -1,12 +1,10 @@ -puts "TODO OCC30286 ALL: Error : The length of result shape is 12.\\d+, expected 12." - puts "========================================================================" puts "OCC27979: Parasolid converted BREP shows weird lines on hidden line Algo" puts "========================================================================" puts "" set viewname "vtop" -set length 12. +set length 13.0106 restore [locate_data_file bug27979_parsed.brep] a COMPUTE_HLR $viewname $algotype diff --git a/tests/mesh/data/standard/W6 b/tests/mesh/data/standard/W6 index c74273990c..8de8ecc13d 100755 --- a/tests/mesh/data/standard/W6 +++ b/tests/mesh/data/standard/W6 @@ -1,6 +1,6 @@ set TheFileName shading_wrongshape_026.brep if { [string compare $command "shading"] == 0 } { - set rel_tol 0.08526389274308782 + set rel_tol 0.1487107687729918 } else { set rel_tol 0.0020125629706199506 } diff --git a/tests/mesh/data/standard/X1 b/tests/mesh/data/standard/X1 index cca36dd09f..d09c119532 100755 --- a/tests/mesh/data/standard/X1 +++ b/tests/mesh/data/standard/X1 @@ -6,7 +6,7 @@ set TheFileName shading_wrongshape_030.brep set bug_cross "OCC22687" set nbcross(All) 4 if { [string compare $command "shading"] == 0 } { - set rel_tol 0.5225697108844659 + set rel_tol 0.48575382373356474 } else { set rel_tol 0.1856053577754922 }