diff --git a/src/BRepMesh/BRepMesh_ConeRangeSplitter.cxx b/src/BRepMesh/BRepMesh_ConeRangeSplitter.cxx index add0a50374..cc61eedb9d 100644 --- a/src/BRepMesh/BRepMesh_ConeRangeSplitter.cxx +++ b/src/BRepMesh/BRepMesh_ConeRangeSplitter.cxx @@ -41,10 +41,13 @@ std::pair BRepMesh_ConeRangeSplitter::GetSplitStep const Standard_Real aDiffU = aRangeU.second - aRangeU.first; const Standard_Real aDiffV = aRangeV.second - aRangeV.first; - Standard_Integer nbU = (Standard_Integer) (aDiffU / Du); - Standard_Integer nbV = (Standard_Integer) (nbU * (aDiffV) / (aDiffU * aRadius)); + const Standard_Real aScale = (Du * aRadius); + const Standard_Real aRatio = Max(1., Log(aDiffV / aScale)); + const Standard_Integer nbU = (Standard_Integer)(aDiffU / Du); + const Standard_Integer nbV = (Standard_Integer)(aDiffV / aScale / aRatio); + Du = aDiffU / (nbU + 1); - Dv = aDiffV / (nbV + 1); + Dv = aDiffV / (nbV + static_cast(aRatio)); theStepsNb.first = nbU; theStepsNb.second = nbV; diff --git a/tests/bugs/mesh/bug25042 b/tests/bugs/mesh/bug25042 index 8f53da4b87..cdee565d5a 100644 --- a/tests/bugs/mesh/bug25042 +++ b/tests/bugs/mesh/bug25042 @@ -14,7 +14,7 @@ vviewparams -scale 1.81755 -proj 0.88572 0.104526 0.452299 -up -0.0339444 0.9862 checkview -screenshot -3d -path ${imagedir}/${test_image}.png -checktrinfo result -tri 957 -nod 558 -defl 1.1088499641289298 -tol_abs_defl 1e-6 +checktrinfo result -tri 509 -nod 327 -defl 1.5916215272983552 -tol_abs_defl 1e-6 set log [tricheck result] if { [llength $log] != 0 } { diff --git a/tests/bugs/mesh/bug25287 b/tests/bugs/mesh/bug25287 index 5b51eeeb95..80336f81b3 100644 --- a/tests/bugs/mesh/bug25287 +++ b/tests/bugs/mesh/bug25287 @@ -11,7 +11,7 @@ renamevar a_1 result incmesh result 0.0001 -a 30 -force_face_def -parallel -checktrinfo result -tri 13854 -nod 9190 -defl 0.00028360162213471898 -tol_abs_defl 1e-6 +checktrinfo result -tri 12512 -nod 8519 -defl 0.00031502118964205414 -tol_abs_defl 1e-6 vinit vsetdispmode 1 diff --git a/tests/bugs/mesh/bug32692_1 b/tests/bugs/mesh/bug32692_1 index db139cb93d..5a85bff3db 100644 --- a/tests/bugs/mesh/bug32692_1 +++ b/tests/bugs/mesh/bug32692_1 @@ -8,4 +8,4 @@ puts "REQUIRED ALL: Meshing statuses: SelfIntersectingWire Failure" restore [locate_data_file bug32692.brep] s incmesh s 0.01 -parallel -checktrinfo s -nod 7511 -tri 7625 -empty 9 -face 309 +checktrinfo s -nod 7427 -tri 7457 -empty 9 -face 309 diff --git a/tests/bugs/mesh/bug32767 b/tests/bugs/mesh/bug32767 index b5e472cfe6..d336f9c9d5 100644 --- a/tests/bugs/mesh/bug32767 +++ b/tests/bugs/mesh/bug32767 @@ -6,4 +6,4 @@ puts "" restore [locate_data_file bug32767.brep] s tclean s incmesh s 0.01 -checktrinfo s -tri 3220 -nod 1770 -defl 0.018398669654253779 -tol_abs_defl 1e-6 \ No newline at end of file +checktrinfo s -tri 1512 -nod 909 -defl 0.035378595363471328 -tol_abs_defl 1e-6 \ No newline at end of file diff --git a/tests/bugs/mesh/bug32982_1 b/tests/bugs/mesh/bug32982_1 new file mode 100644 index 0000000000..e4640ef7bc --- /dev/null +++ b/tests/bugs/mesh/bug32982_1 @@ -0,0 +1,19 @@ +puts "=========" +puts "OCC32982: Mesh - Meshing the shape takes too long and visualization is bad" +puts "=========" +puts "" + +restore [locate_data_file bug32982.brep] result +incmesh result 5.58 + +checktrinfo result -nod 4036 -tri 7450 + +vinit +vdefaults -autoTriang 0 +vdisplay result +vsetdispmode 1 +vfit +vpan -5 198 +vzoom 150 + +checkview -screenshot -3d -path ${imagedir}/${test_image}.png diff --git a/tests/bugs/mesh/bug32982_2 b/tests/bugs/mesh/bug32982_2 new file mode 100644 index 0000000000..1cf708972c --- /dev/null +++ b/tests/bugs/mesh/bug32982_2 @@ -0,0 +1,21 @@ +puts "=========" +puts "OCC32982: Mesh - Meshing the shape takes too long and visualization is bad" +puts "=========" +puts "" + +restore [locate_data_file bug32982.brep] result + +tscale result 9.7978019714355504 25.567642604431001 42.7875250671255 0.001 +incmesh result 0.00558 + +checktrinfo result -nod 4036 -tri 7450 + +vinit +vdefaults -autoTriang 0 +vdisplay result +vsetdispmode 1 +vfit +vpan -5 198 +vzoom 150 + +checkview -screenshot -3d -path ${imagedir}/${test_image}.png